aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatt Corallo <git@bluematt.me>2016-10-02 12:45:24 -0400
committerMatt Corallo <git@bluematt.me>2016-10-31 10:08:11 -0400
commitd8670fb103f95e6dc6f469d71c9ee4f6ff2407e0 (patch)
tree41a155b5e470350114936ca609f2d61e09bfc36d /src
parentd6ea737be19a0001e69e4e854eb1cef21523ea7a (diff)
downloadbitcoin-d8670fb103f95e6dc6f469d71c9ee4f6ff2407e0.tar.xz
Move all calls to CheckBlockIndex out of net-processing logic
This will result in many more calls to CheckBlockIndex when connecting a list of headers (eg in ::HEADERS messages processing) but its only enabled in debug mode, and that should mostly just be during IBD, so it should be OK.
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 5be97d5867..b99515a656 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -3675,6 +3675,8 @@ static bool AcceptBlockHeader(const CBlockHeader& block, CValidationState& state
if (ppindex)
*ppindex = pindex;
+ CheckBlockIndex(chainparams.GetConsensus());
+
return true;
}
@@ -5827,8 +5829,6 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
return ProcessMessage(pfrom, NetMsgType::HEADERS, vHeadersMsg, nTimeReceived, chainparams, connman);
}
}
-
- CheckBlockIndex(chainparams.GetConsensus());
}
else if (strCommand == NetMsgType::BLOCKTXN && !fImporting && !fReindex) // Ignore blocks received while importing
@@ -6025,8 +6025,6 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
}
}
}
-
- CheckBlockIndex(chainparams.GetConsensus());
}
NotifyHeaderTip();