mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 14:46:42 +00:00
whisper: build fix
This commit is contained in:
parent
8f59d03fee
commit
827a835427
1 changed files with 12 additions and 2 deletions
|
|
@ -78,8 +78,8 @@ type TestData struct {
|
|||
type TestNode struct {
|
||||
shh *Whisper
|
||||
id *ecdsa.PrivateKey
|
||||
server *p2p.Server
|
||||
filerId int
|
||||
server p2p.Server
|
||||
}
|
||||
|
||||
var result TestData
|
||||
|
|
@ -139,7 +139,7 @@ func initialize(x *testing.T) {
|
|||
peers = append(peers, peer)
|
||||
}
|
||||
|
||||
node.server = p2p.Server{
|
||||
node.server = &p2p.Server{
|
||||
Config: p2p.Config{
|
||||
PrivateKey: node.id,
|
||||
MaxPeers: NumNodes/2 + 1,
|
||||
|
|
@ -167,6 +167,7 @@ func stopServers() {
|
|||
for i := 0; i < NumNodes; i++ {
|
||||
n := nodes[i]
|
||||
if n != nil {
|
||||
n.shh.Unwatch(n.filerId)
|
||||
n.server.Stop()
|
||||
}
|
||||
}
|
||||
|
|
@ -196,6 +197,7 @@ func checkPropagation(x *testing.T) {
|
|||
}
|
||||
|
||||
if isTestComplete() {
|
||||
|
||||
return
|
||||
}
|
||||
}
|
||||
|
|
@ -242,6 +244,14 @@ func isTestComplete() bool {
|
|||
return false
|
||||
}
|
||||
}
|
||||
|
||||
for i := 0; i < NumNodes; i++ {
|
||||
envelopes := nodes[i].shh.Envelopes()
|
||||
if len(envelopes) < 2 {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue