Start vote generator for changed winner only if voting is enabled (#2593)

This commit is contained in:
Sergey Kroshnin 2020-02-26 22:49:48 +03:00 committed by GitHub
commit a77c0f1b6e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -118,8 +118,11 @@ void nano::election::confirm_if_quorum ()
}
if (sum >= node.config.online_weight_minimum.number () && winner_hash_l != status_winner_hash_l)
{
node.votes_cache.remove (status_winner_hash_l);
node.block_processor.generator.add (winner_hash_l);
if (node.config.enable_voting && node.wallets.rep_counts ().voting > 0)
{
node.votes_cache.remove (status_winner_hash_l);
node.block_processor.generator.add (winner_hash_l);
}
node.block_processor.force (block_l);
status.winner = block_l;
update_dependent ();