diff --git a/src/validation.cpp b/src/validation.cpp --- a/src/validation.cpp +++ b/src/validation.cpp @@ -222,8 +222,7 @@ void InvalidBlockFound(CBlockIndex *pindex, const CValidationState &state) EXCLUSIVE_LOCKS_REQUIRED(cs_main); CBlockIndex *FindMostWorkChain() EXCLUSIVE_LOCKS_REQUIRED(cs_main); - bool ReceivedBlockTransactions(const CBlock &block, CValidationState &state, - CBlockIndex *pindexNew, + void ReceivedBlockTransactions(const CBlock &block, CBlockIndex *pindexNew, const FlatFilePos &pos) EXCLUSIVE_LOCKS_REQUIRED(cs_main); @@ -3293,8 +3292,7 @@ * Mark a block as having its data received and checked (up to * BLOCK_VALID_TRANSACTIONS). */ -bool CChainState::ReceivedBlockTransactions(const CBlock &block, - CValidationState &state, +void CChainState::ReceivedBlockTransactions(const CBlock &block, CBlockIndex *pindexNew, const FlatFilePos &pos) { pindexNew->nTx = block.vtx.size(); @@ -3349,8 +3347,6 @@ pindexNew->pprev->IsValid(BlockValidity::TREE)) { mapBlocksUnlinked.insert(std::make_pair(pindexNew->pprev, pindexNew)); } - - return true; } static bool FindBlockPos(FlatFilePos &pos, unsigned int nAddSize, @@ -4081,9 +4077,7 @@ __func__)); return false; } - if (!ReceivedBlockTransactions(block, state, pindex, blockPos)) { - return error("AcceptBlock(): ReceivedBlockTransactions failed"); - } + ReceivedBlockTransactions(block, pindex, blockPos); } catch (const std::runtime_error &e) { return AbortNode(state, std::string("System error: ") + e.what()); } @@ -4976,11 +4970,7 @@ return error("%s: writing genesis block to disk failed", __func__); } CBlockIndex *pindex = AddToBlockIndex(block); - CValidationState state; - if (!ReceivedBlockTransactions(block, state, pindex, blockPos)) { - return error("%s: genesis block not accepted (%s)", __func__, - FormatStateMessage(state)); - } + ReceivedBlockTransactions(block, pindex, blockPos); } catch (const std::runtime_error &e) { return error("%s: failed to write genesis block: %s", __func__, e.what());