diff --git a/nano/core_test/conflicts.cpp b/nano/core_test/conflicts.cpp index b117105d..d6521949 100644 --- a/nano/core_test/conflicts.cpp +++ b/nano/core_test/conflicts.cpp @@ -244,7 +244,11 @@ TEST (conflicts, adjusted_difficulty) auto change1 (std::make_shared (key3.pub, open2->hash (), nano::test_genesis_key.pub, nano::xrb_ratio, 0, key3.prv, key3.pub, system.work.generate (open2->hash ()))); node1.process_active (change1); node1.block_processor.flush (); - ASSERT_EQ (11, node1.active.size ()); + system.deadline_set (3s); + while (node1.active.size () != 11) + { + ASSERT_NO_ERROR (system.poll ()); + } std::unordered_map adjusted_difficulties; { std::lock_guard guard (node1.active.mutex); @@ -276,7 +280,11 @@ TEST (conflicts, adjusted_difficulty) ASSERT_GT (difficulty, adjusted_difficulties.find (genesis.hash ())->second); node1.process_active (open_epoch2); node1.block_processor.flush (); - ASSERT_EQ (12, node1.active.size ()); + system.deadline_set (3s); + while (node1.active.size () != 12) + { + ASSERT_NO_ERROR (system.poll ()); + } { std::lock_guard guard (node1.active.mutex); ASSERT_EQ (node1.active.roots.get<1> ().begin ()->election->status.winner->hash (), open_epoch2->hash ()); diff --git a/nano/node/active_transactions.cpp b/nano/node/active_transactions.cpp index b3734fb7..f3369309 100644 --- a/nano/node/active_transactions.cpp +++ b/nano/node/active_transactions.cpp @@ -76,6 +76,7 @@ void nano::active_transactions::request_confirm (std::unique_lock & auto transaction (node.store.tx_begin_read ()); unsigned unconfirmed_count (0); unsigned unconfirmed_announcements (0); + unsigned could_fit_delay = node.network_params.network.is_test_network () ? 10 : 1; std::unordered_map, std::vector>> requests_bundle; std::deque> rebroadcast_bundle; std::deque, std::shared_ptr>>>> confirm_req_bundle; @@ -141,7 +142,7 @@ void nano::active_transactions::request_confirm (std::unique_lock & election_l->update_dependent (); } } - if (election_l->announcements < announcement_long || election_l->announcements % announcement_long == 1) + if (election_l->announcements < announcement_long || election_l->announcements % announcement_long == could_fit_delay) { if (node.ledger.could_fit (transaction, *election_l->status.winner)) {