@@ -205,7 +205,7 @@ class CChainState {
205
205
206
206
void InvalidBlockFound (CBlockIndex *pindex, const CValidationState &state);
207
207
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);
209
209
210
210
211
211
bool RollforwardBlock (const CBlockIndex* pindex, CCoinsViewCache& inputs, const CChainParams& params);
@@ -2956,7 +2956,7 @@ CBlockIndex* CChainState::AddToBlockIndex(const CBlockHeader& block)
2956
2956
}
2957
2957
2958
2958
/* * 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)
2960
2960
{
2961
2961
pindexNew->nTx = block.vtx .size ();
2962
2962
pindexNew->nChainTx = 0 ;
@@ -3000,8 +3000,6 @@ bool CChainState::ReceivedBlockTransactions(const CBlock &block, CValidationStat
3000
3000
mapBlocksUnlinked.insert (std::make_pair (pindexNew->pprev , pindexNew));
3001
3001
}
3002
3002
}
3003
-
3004
- return true ;
3005
3003
}
3006
3004
3007
3005
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
3536
3534
state.Error (strprintf (" %s: Failed to find position to write new block to disk" , __func__));
3537
3535
return false ;
3538
3536
}
3539
- if (!ReceivedBlockTransactions (block, state, pindex, blockPos, chainparams.GetConsensus ()))
3540
- return error (" AcceptBlock(): ReceivedBlockTransactions failed" );
3537
+ ReceivedBlockTransactions (block, pindex, blockPos, chainparams.GetConsensus ());
3541
3538
} catch (const std::runtime_error& e) {
3542
3539
return AbortNode (state, std::string (" System error: " ) + e.what ());
3543
3540
}
@@ -4346,9 +4343,7 @@ bool CChainState::LoadGenesisBlock(const CChainParams& chainparams)
4346
4343
if (blockPos.IsNull ())
4347
4344
return error (" %s: writing genesis block to disk failed" , __func__);
4348
4345
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 ());
4352
4347
} catch (const std::runtime_error& e) {
4353
4348
return error (" %s: failed to write genesis block: %s" , __func__, e.what ());
4354
4349
}
0 commit comments