@@ -2830,8 +2830,9 @@ bool Chainstate::DisconnectTip(BlockValidationState& state, DisconnectedBlockTra
2830
2830
{
2831
2831
CCoinsViewCache view (&CoinsTip ());
2832
2832
assert (view.GetBestBlock () == pindexDelete->GetBlockHash ());
2833
- if (DisconnectBlock (block, pindexDelete, view) != DISCONNECT_OK)
2833
+ if (DisconnectBlock (block, pindexDelete, view) != DISCONNECT_OK) {
2834
2834
return error (" DisconnectTip(): DisconnectBlock %s failed" , pindexDelete->GetBlockHash ().ToString ());
2835
+ }
2835
2836
bool flushed = view.Flush ();
2836
2837
assert (flushed);
2837
2838
}
@@ -4358,12 +4359,15 @@ bool TestBlockValidity(BlockValidationState& state,
4358
4359
indexDummy.phashBlock = &block_hash;
4359
4360
4360
4361
// NOTE: CheckBlockHeader is called by CheckBlock
4361
- if (!ContextualCheckBlockHeader (block, state, chainstate.m_blockman , chainstate.m_chainman , pindexPrev))
4362
+ if (!ContextualCheckBlockHeader (block, state, chainstate.m_blockman , chainstate.m_chainman , pindexPrev)) {
4362
4363
return error (" %s: Consensus::ContextualCheckBlockHeader: %s" , __func__, state.ToString ());
4363
- if (!CheckBlock (block, state, chainparams.GetConsensus (), fCheckPOW , fCheckMerkleRoot ))
4364
+ }
4365
+ if (!CheckBlock (block, state, chainparams.GetConsensus (), fCheckPOW , fCheckMerkleRoot )) {
4364
4366
return error (" %s: Consensus::CheckBlock: %s" , __func__, state.ToString ());
4365
- if (!ContextualCheckBlock (block, state, chainstate.m_chainman , pindexPrev))
4367
+ }
4368
+ if (!ContextualCheckBlock (block, state, chainstate.m_chainman , pindexPrev)) {
4366
4369
return error (" %s: Consensus::ContextualCheckBlock: %s" , __func__, state.ToString ());
4370
+ }
4367
4371
if (!chainstate.ConnectBlock (block, state, &indexDummy, viewNew, true )) {
4368
4372
return false ;
4369
4373
}
@@ -4591,7 +4595,9 @@ bool Chainstate::ReplayBlocks()
4591
4595
4592
4596
std::vector<uint256> hashHeads = db.GetHeadBlocks ();
4593
4597
if (hashHeads.empty ()) return true ; // We're already in a consistent state.
4594
- if (hashHeads.size () != 2 ) return error (" ReplayBlocks(): unknown inconsistent state" );
4598
+ if (hashHeads.size () != 2 ) {
4599
+ return error (" ReplayBlocks(): unknown inconsistent state" );
4600
+ }
4595
4601
4596
4602
m_chainman.GetNotifications ().progress (_ (" Replaying blocks…" ), 0 , false );
4597
4603
LogPrintf (" Replaying blocks\n " );
0 commit comments