From bd3fed43b9710b77670bd8b3f04e90d25f311459 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Sun, 1 Feb 2015 22:48:52 -0800 Subject: [PATCH] Don't count same messages twice. --- whisperTopic.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/whisperTopic.cpp b/whisperTopic.cpp index 0162124b8..119373361 100644 --- a/whisperTopic.cpp +++ b/whisperTopic.cpp @@ -50,6 +50,7 @@ BOOST_AUTO_TEST_CASE(topic) auto w = wh->installWatch(BuildTopicMask("odd")); started = true; + set received; for (int iterout = 0, last = 0; iterout < 200 && last < 81; ++iterout) { @@ -57,6 +58,9 @@ BOOST_AUTO_TEST_CASE(topic) { Message msg = wh->envelope(i).open(wh->fullTopic(w)); last = RLP(msg.payload()).toInt(); + if (received.count(last)) + continue; + received.insert(last); cnote << "New message from:" << msg.from().abridged() << RLP(msg.payload()).toInt(); result += last; }