Skip to content

Commit

Permalink
Apply similar fix to node_telemetry.remove_peer_different_genesis_udp…
Browse files Browse the repository at this point in the history
… as the tcp version in nanocurrency#2738
  • Loading branch information
guilhermelawless committed Apr 29, 2020
1 parent 663c7c3 commit 8ada651
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions nano/core_test/node_telemetry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -774,12 +774,12 @@ TEST (node_telemetry, remove_peer_different_genesis_udp)

ASSERT_TIMELY (10s, node0->stats.count (nano::stat::type::telemetry, nano::stat::detail::different_genesis_hash) != 0 && node1->stats.count (nano::stat::type::telemetry, nano::stat::detail::different_genesis_hash) != 0);

ASSERT_EQ (0, node0->network.size ());
ASSERT_EQ (0, node1->network.size ());
system.poll_until_true (3s, [&node0, address = node1->network.endpoint ().address ()]() -> bool {
nano::lock_guard<std::mutex> guard (node0->network.excluded_peers.mutex);
return node0->network.excluded_peers.peers.get<nano::peer_exclusion::tag_endpoint> ().count (address);
});
ASSERT_TIMELY (1s, 0 == node0->network.size ());
ASSERT_TIMELY (1s, 0 == node1->network.size ());

nano::lock_guard<std::mutex> guard (node0->network.excluded_peers.mutex);
ASSERT_EQ (1, node0->network.excluded_peers.peers.get<nano::peer_exclusion::tag_endpoint> ().count (node1->network.endpoint ().address ()));
ASSERT_EQ (1, node1->network.excluded_peers.peers.get<nano::peer_exclusion::tag_endpoint> ().count (node0->network.endpoint ().address ()));
}

TEST (node_telemetry, remove_peer_invalid_signature)
Expand Down

0 comments on commit 8ada651

Please sign in to comment.