mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
swarm/network: lock use of hive.depth
This commit is contained in:
parent
ad17048bd4
commit
0949c1dfb5
1 changed files with 5 additions and 1 deletions
|
|
@ -162,6 +162,10 @@ func testSubpeersMsg(t *testing.T) {
|
|||
controlDepth = 2
|
||||
}
|
||||
|
||||
hive.lock.Lock()
|
||||
hiveDepth := hive.depth
|
||||
hive.lock.Unlock()
|
||||
|
||||
// the test exchange is as follows:
|
||||
// 1. Wait for a `subPeersMsg` advertizing the hive's depth from our hive to our control node
|
||||
// 2. Trigger a `suPeersMsg` from the control node advertizing its own depth
|
||||
|
|
@ -171,7 +175,7 @@ func testSubpeersMsg(t *testing.T) {
|
|||
Expects: []p2ptest.Expect{
|
||||
{
|
||||
Code: 1,
|
||||
Msg: &subPeersMsg{Depth: uint8(hive.depth)},
|
||||
Msg: &subPeersMsg{Depth: uint8(hiveDepth)},
|
||||
Peer: control.ID(),
|
||||
},
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue