Skip to content

Commit

Permalink
Remove short election expiration time for dev network
Browse files Browse the repository at this point in the history
It makes it difficult/impossible to access election objects in unit tests
and it increases complexity for no obvious benefit.

This change could potentially fix a lot of unit test race conditions.

Fixes nanocurrency#3584 and probably many other unit tests.
  • Loading branch information
dsiganos committed Dec 6, 2021
1 parent 7eddc04 commit 055e69f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nano/node/election.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ bool nano::election::transition_time (nano::confirmation_solicitor & solicitor_a
debug_assert (false);
break;
}
auto const optimistic_expiration_time = node.network_params.network.is_dev_network () ? 500 : 60 * 1000;
auto const optimistic_expiration_time = 60 * 1000;
auto const expire_time = std::chrono::milliseconds (optimistic () ? optimistic_expiration_time : 5 * 60 * 1000);
if (!confirmed () && expire_time < std::chrono::steady_clock::now () - election_start)
{
Expand Down

0 comments on commit 055e69f

Please sign in to comment.