diff --git a/db/BlockProposalDB.cpp b/db/BlockProposalDB.cpp index 035c38d9..d3d343bc 100644 --- a/db/BlockProposalDB.cpp +++ b/db/BlockProposalDB.cpp @@ -84,8 +84,10 @@ void BlockProposalDB::addBlockProposal( const ptr< BlockProposal > _proposal ) { // save own proposal to levelDB if ( _proposal->getProposerIndex() == getSchain()->getSchainIndex() ) { - // for optimized consensus only the winner of the previous similar round will send the proposal - // to the network. Therefor we + // for optimized consensus only previous winner proposed. + // non-winners skip sending proposal and do not need to save it to the db + // since saving proposal to the db is done to be able to resend it in case of a + // crash if (getSchain()->getOptimizerAgent()->skipSendingProposalToTheNetwork(_proposal->getBlockID())) return; diff --git a/monitoring/OptimizerAgent.cpp b/monitoring/OptimizerAgent.cpp index 50a86ffd..1edd486a 100644 --- a/monitoring/OptimizerAgent.cpp +++ b/monitoring/OptimizerAgent.cpp @@ -67,8 +67,8 @@ schain_index OptimizerAgent::getLastWinner(block_id _blockId) { } schain_index OptimizerAgent::skipSendingProposalToTheNetwork(block_id _blockId) { - // node skips sending proposal if the current block consensus - // is optimized consensus and if node chain index is not equal to the last winner + // whe we run optimized consensus a node skips sending proposal to the network + // if node chain index is not equal to the last winner return (getSchain()->getOptimizerAgent()->doOptimizedConsensus(_blockId) && (getSchain()->getOptimizerAgent()->getLastWinner(_blockId) != getSchain()->getSchainIndex())); }