Skip to content

Commit fafa270

Browse files
author
MarcoFalke
committed
Make ReceivedBlockTransactions return void
1 parent f8bcef3 commit fafa270

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/validation.cpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ class CChainState {
205205

206206
void InvalidBlockFound(CBlockIndex *pindex, const CValidationState &state);
207207
CBlockIndex* FindMostWorkChain();
208-
bool ReceivedBlockTransactions(const CBlock &block, CValidationState& state, CBlockIndex *pindexNew, const CDiskBlockPos& pos, const Consensus::Params& consensusParams);
208+
void ReceivedBlockTransactions(const CBlock& block, CBlockIndex* pindexNew, const CDiskBlockPos& pos, const Consensus::Params& consensusParams);
209209

210210

211211
bool RollforwardBlock(const CBlockIndex* pindex, CCoinsViewCache& inputs, const CChainParams& params);
@@ -2956,7 +2956,7 @@ CBlockIndex* CChainState::AddToBlockIndex(const CBlockHeader& block)
29562956
}
29572957

29582958
/** Mark a block as having its data received and checked (up to BLOCK_VALID_TRANSACTIONS). */
2959-
bool CChainState::ReceivedBlockTransactions(const CBlock &block, CValidationState& state, CBlockIndex *pindexNew, const CDiskBlockPos& pos, const Consensus::Params& consensusParams)
2959+
void CChainState::ReceivedBlockTransactions(const CBlock& block, CBlockIndex* pindexNew, const CDiskBlockPos& pos, const Consensus::Params& consensusParams)
29602960
{
29612961
pindexNew->nTx = block.vtx.size();
29622962
pindexNew->nChainTx = 0;
@@ -3000,8 +3000,6 @@ bool CChainState::ReceivedBlockTransactions(const CBlock &block, CValidationStat
30003000
mapBlocksUnlinked.insert(std::make_pair(pindexNew->pprev, pindexNew));
30013001
}
30023002
}
3003-
3004-
return true;
30053003
}
30063004

30073005
static bool FindBlockPos(CDiskBlockPos &pos, unsigned int nAddSize, unsigned int nHeight, uint64_t nTime, bool fKnown = false)
@@ -3536,8 +3534,7 @@ bool CChainState::AcceptBlock(const std::shared_ptr<const CBlock>& pblock, CVali
35363534
state.Error(strprintf("%s: Failed to find position to write new block to disk", __func__));
35373535
return false;
35383536
}
3539-
if (!ReceivedBlockTransactions(block, state, pindex, blockPos, chainparams.GetConsensus()))
3540-
return error("AcceptBlock(): ReceivedBlockTransactions failed");
3537+
ReceivedBlockTransactions(block, pindex, blockPos, chainparams.GetConsensus());
35413538
} catch (const std::runtime_error& e) {
35423539
return AbortNode(state, std::string("System error: ") + e.what());
35433540
}
@@ -4346,9 +4343,7 @@ bool CChainState::LoadGenesisBlock(const CChainParams& chainparams)
43464343
if (blockPos.IsNull())
43474344
return error("%s: writing genesis block to disk failed", __func__);
43484345
CBlockIndex *pindex = AddToBlockIndex(block);
4349-
CValidationState state;
4350-
if (!ReceivedBlockTransactions(block, state, pindex, blockPos, chainparams.GetConsensus()))
4351-
return error("%s: genesis block not accepted (%s)", __func__, FormatStateMessage(state));
4346+
ReceivedBlockTransactions(block, pindex, blockPos, chainparams.GetConsensus());
43524347
} catch (const std::runtime_error& e) {
43534348
return error("%s: failed to write genesis block: %s", __func__, e.what());
43544349
}

0 commit comments

Comments
 (0)