From 827a835427ee7aeb0138d4e94566003c072d2263 Mon Sep 17 00:00:00 2001 From: Vlad Date: Wed, 26 Oct 2016 20:34:26 +0200 Subject: [PATCH] whisper: build fix --- whisper/whisperv5/peer_test.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/whisper/whisperv5/peer_test.go b/whisper/whisperv5/peer_test.go index 5adf60ef56..03c4725d8e 100644 --- a/whisper/whisperv5/peer_test.go +++ b/whisper/whisperv5/peer_test.go @@ -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 }