aboutsummaryrefslogtreecommitdiff
path: root/src/validation.cpp
diff options
context:
space:
mode:
authorMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2024-01-11 18:34:56 +0100
committerMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2024-03-11 13:49:25 +0100
commitfa9a5e80ab86c997102a1c3d4ba017bbe86641d5 (patch)
tree2ff82dc65e56b1b130a3c812b9230d4ffdc6d1df /src/validation.cpp
parent4a903741b0bc128745b1096586329456d1f1c447 (diff)
downloadbitcoin-fa9a5e80ab86c997102a1c3d4ba017bbe86641d5.tar.xz
refactor: Add missing {} around error() calls
This is required for the next commit to be correct.
Diffstat (limited to 'src/validation.cpp')
-rw-r--r--src/validation.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index c15e660499..84941f894f 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -2830,8 +2830,9 @@ bool Chainstate::DisconnectTip(BlockValidationState& state, DisconnectedBlockTra
{
CCoinsViewCache view(&CoinsTip());
assert(view.GetBestBlock() == pindexDelete->GetBlockHash());
- if (DisconnectBlock(block, pindexDelete, view) != DISCONNECT_OK)
+ if (DisconnectBlock(block, pindexDelete, view) != DISCONNECT_OK) {
return error("DisconnectTip(): DisconnectBlock %s failed", pindexDelete->GetBlockHash().ToString());
+ }
bool flushed = view.Flush();
assert(flushed);
}
@@ -4358,12 +4359,15 @@ bool TestBlockValidity(BlockValidationState& state,
indexDummy.phashBlock = &block_hash;
// NOTE: CheckBlockHeader is called by CheckBlock
- if (!ContextualCheckBlockHeader(block, state, chainstate.m_blockman, chainstate.m_chainman, pindexPrev))
+ if (!ContextualCheckBlockHeader(block, state, chainstate.m_blockman, chainstate.m_chainman, pindexPrev)) {
return error("%s: Consensus::ContextualCheckBlockHeader: %s", __func__, state.ToString());
- if (!CheckBlock(block, state, chainparams.GetConsensus(), fCheckPOW, fCheckMerkleRoot))
+ }
+ if (!CheckBlock(block, state, chainparams.GetConsensus(), fCheckPOW, fCheckMerkleRoot)) {
return error("%s: Consensus::CheckBlock: %s", __func__, state.ToString());
- if (!ContextualCheckBlock(block, state, chainstate.m_chainman, pindexPrev))
+ }
+ if (!ContextualCheckBlock(block, state, chainstate.m_chainman, pindexPrev)) {
return error("%s: Consensus::ContextualCheckBlock: %s", __func__, state.ToString());
+ }
if (!chainstate.ConnectBlock(block, state, &indexDummy, viewNew, true)) {
return false;
}
@@ -4591,7 +4595,9 @@ bool Chainstate::ReplayBlocks()
std::vector<uint256> hashHeads = db.GetHeadBlocks();
if (hashHeads.empty()) return true; // We're already in a consistent state.
- if (hashHeads.size() != 2) return error("ReplayBlocks(): unknown inconsistent state");
+ if (hashHeads.size() != 2) {
+ return error("ReplayBlocks(): unknown inconsistent state");
+ }
m_chainman.GetNotifications().progress(_("Replaying blocks…"), 0, false);
LogPrintf("Replaying blocks\n");