Adjust active_transactions.pessimistic_elections & network.last_contacted (#3270)

* active_transactions.pessimistic_elections - Follow test commentary
* network.last_contacted - Prevent ephemeral node1->node0 channel repacement in container with incoming connection
This commit is contained in:
Sergey Kroshnin 2021-05-10 18:44:03 +03:00 committed by GitHub
commit 667e26ae48
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -1396,7 +1396,7 @@ TEST (active_transactions, pessimistic_elections)
}
// Wait until activation of destination account is done.
ASSERT_TIMELY (10s, node.active.active (send2->qualified_root ()));
ASSERT_TIMELY (10s, node.active.active (open->qualified_root ()));
// Election count should not increase, but the elections should be marked as started for that account afterwards
ASSERT_EQ (election_started_it->election_started, false);

View file

@ -135,7 +135,9 @@ TEST (network, last_contacted)
nano::system system (1);
auto node0 = system.nodes[0];
ASSERT_EQ (0, node0->network.size ());
auto node1 (std::make_shared<nano::node> (system.io_ctx, nano::get_available_port (), nano::unique_path (), system.logging, system.work));
nano::node_config node1_config (nano::get_available_port (), system.logging);
node1_config.tcp_incoming_connections_max = 0; // Prevent ephemeral node1->node0 channel repacement with incoming connection
auto node1 (std::make_shared<nano::node> (system.io_ctx, nano::unique_path (), node1_config, system.work));
node1->start ();
system.nodes.push_back (node1);
auto channel1 = nano::establish_tcp (system, *node1, node0->network.endpoint ());