Skip to content

Commit fa99efd

Browse files
author
MarcoFalke
committed
doc: ActivateBestChainStep return value
1 parent 119e97a commit fa99efd

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/validation.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2472,6 +2472,8 @@ void CChainState::PruneBlockIndexCandidates() {
24722472
/**
24732473
* Try to make some progress towards making pindexMostWork the active block.
24742474
* pblock is either nullptr or a pointer to a CBlock corresponding to pindexMostWork.
2475+
*
2476+
* @returns true unless a system error occurred
24752477
*/
24762478
bool CChainState::ActivateBestChainStep(CValidationState& state, const CChainParams& chainparams, CBlockIndex* pindexMostWork, const std::shared_ptr<const CBlock>& pblock, bool& fInvalidFound, ConnectTrace& connectTrace)
24772479
{
@@ -2598,6 +2600,8 @@ static void LimitValidationInterfaceQueue() LOCKS_EXCLUDED(cs_main) {
25982600
* ActivateBestChain is split into steps (see ActivateBestChainStep) so that
25992601
* we avoid holding cs_main for an extended period of time; the length of this
26002602
* call may be quite long during reindexing or a substantial reorg.
2603+
*
2604+
* @returns true unless a system error occurred
26012605
*/
26022606
bool CChainState::ActivateBestChain(CValidationState &state, const CChainParams& chainparams, std::shared_ptr<const CBlock> pblock) {
26032607
// Note that while we're often called here from ProcessNewBlock, this is
@@ -2646,8 +2650,10 @@ bool CChainState::ActivateBestChain(CValidationState &state, const CChainParams&
26462650

26472651
bool fInvalidFound = false;
26482652
std::shared_ptr<const CBlock> nullBlockPtr;
2649-
if (!ActivateBestChainStep(state, chainparams, pindexMostWork, pblock && pblock->GetHash() == pindexMostWork->GetBlockHash() ? pblock : nullBlockPtr, fInvalidFound, connectTrace))
2653+
if (!ActivateBestChainStep(state, chainparams, pindexMostWork, pblock && pblock->GetHash() == pindexMostWork->GetBlockHash() ? pblock : nullBlockPtr, fInvalidFound, connectTrace)) {
2654+
// A system error occurred
26502655
return false;
2656+
}
26512657
blocks_connected = true;
26522658

26532659
if (fInvalidFound) {

src/validation.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ static const uint64_t MIN_DISK_SPACE_FOR_BLOCK_FILES = 550 * 1024 * 1024;
211211
* @param[in] pblock The block we want to process.
212212
* @param[in] fForceProcessing Process this block even if unrequested; used for non-network block sources and whitelisted peers.
213213
* @param[out] fNewBlock A boolean which is set to indicate if the block was first received via this call
214-
* @return True if state.IsValid()
214+
* @returns If the block was processed, independently of block validity
215215
*/
216216
bool ProcessNewBlock(const CChainParams& chainparams, const std::shared_ptr<const CBlock> pblock, bool fForceProcessing, bool* fNewBlock) LOCKS_EXCLUDED(cs_main);
217217

@@ -653,6 +653,8 @@ class CChainState {
653653
*
654654
* If FlushStateMode::NONE is used, then FlushStateToDisk(...) won't do anything
655655
* besides checking if we need to prune.
656+
*
657+
* @returns true unless a system error occurred
656658
*/
657659
bool FlushStateToDisk(
658660
const CChainParams& chainparams,

0 commit comments

Comments
 (0)