Start elections for processed blocks after transaction commit (#1219)
This commit is contained in:
parent
46be611777
commit
bde5072da0
2 changed files with 10 additions and 2 deletions
|
@ -1574,6 +1574,13 @@ void rai::block_processor::process_receive_many (std::unique_lock<std::mutex> &
|
|||
++count;
|
||||
}
|
||||
}
|
||||
// Start elections for recent blocks
|
||||
while (!processed_active.empty ())
|
||||
{
|
||||
auto block (processed_active.front ());
|
||||
processed_active.pop_front ();
|
||||
node.active.start (block);
|
||||
}
|
||||
lock_a.unlock ();
|
||||
}
|
||||
|
||||
|
@ -1594,7 +1601,7 @@ rai::process_return rai::block_processor::process_receive_one (rai::transaction
|
|||
}
|
||||
if (node.block_arrival.recent (hash))
|
||||
{
|
||||
node.active.start (block_a);
|
||||
processed_active.push_back (block_a);
|
||||
}
|
||||
queue_unchecked (transaction_a, hash);
|
||||
break;
|
||||
|
@ -3882,7 +3889,7 @@ void rai::active_transactions::announce_votes ()
|
|||
node.network.republish_block (transaction, election_l->status.winner);
|
||||
}
|
||||
}
|
||||
else if (i->announcements > 3)
|
||||
else
|
||||
{
|
||||
election_l->abort ();
|
||||
}
|
||||
|
|
|
@ -625,6 +625,7 @@ private:
|
|||
std::deque<std::pair<std::shared_ptr<rai::block>, std::chrono::steady_clock::time_point>> blocks;
|
||||
std::unordered_set<rai::block_hash> blocks_hashes;
|
||||
std::deque<std::shared_ptr<rai::block>> forced;
|
||||
std::deque<std::shared_ptr<rai::block>> processed_active;
|
||||
std::condition_variable condition;
|
||||
rai::node & node;
|
||||
std::mutex mutex;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue