aboutsummaryrefslogtreecommitdiff
path: root/src/validation.cpp
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2019-08-29 12:42:00 -0400
committerMarcoFalke <falke.marco@gmail.com>2019-09-03 07:32:33 -0400
commitfa99efd054c57cd6717391f9ae8ce32b06986ff8 (patch)
treef70a63fa9144a720415528008c87011f78875859 /src/validation.cpp
parent119e97ae2d805fc29ef3744fff401ef289a19f8e (diff)
downloadbitcoin-fa99efd054c57cd6717391f9ae8ce32b06986ff8.tar.xz
doc: ActivateBestChainStep return value
Diffstat (limited to 'src/validation.cpp')
-rw-r--r--src/validation.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index 74f68a3047..57028fa669 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -2472,6 +2472,8 @@ void CChainState::PruneBlockIndexCandidates() {
/**
* Try to make some progress towards making pindexMostWork the active block.
* pblock is either nullptr or a pointer to a CBlock corresponding to pindexMostWork.
+ *
+ * @returns true unless a system error occurred
*/
bool CChainState::ActivateBestChainStep(CValidationState& state, const CChainParams& chainparams, CBlockIndex* pindexMostWork, const std::shared_ptr<const CBlock>& pblock, bool& fInvalidFound, ConnectTrace& connectTrace)
{
@@ -2598,6 +2600,8 @@ static void LimitValidationInterfaceQueue() LOCKS_EXCLUDED(cs_main) {
* ActivateBestChain is split into steps (see ActivateBestChainStep) so that
* we avoid holding cs_main for an extended period of time; the length of this
* call may be quite long during reindexing or a substantial reorg.
+ *
+ * @returns true unless a system error occurred
*/
bool CChainState::ActivateBestChain(CValidationState &state, const CChainParams& chainparams, std::shared_ptr<const CBlock> pblock) {
// Note that while we're often called here from ProcessNewBlock, this is
@@ -2646,8 +2650,10 @@ bool CChainState::ActivateBestChain(CValidationState &state, const CChainParams&
bool fInvalidFound = false;
std::shared_ptr<const CBlock> nullBlockPtr;
- if (!ActivateBestChainStep(state, chainparams, pindexMostWork, pblock && pblock->GetHash() == pindexMostWork->GetBlockHash() ? pblock : nullBlockPtr, fInvalidFound, connectTrace))
+ if (!ActivateBestChainStep(state, chainparams, pindexMostWork, pblock && pblock->GetHash() == pindexMostWork->GetBlockHash() ? pblock : nullBlockPtr, fInvalidFound, connectTrace)) {
+ // A system error occurred
return false;
+ }
blocks_connected = true;
if (fInvalidFound) {