diff options
| author | Matt Corallo <[email protected]> | 2017-01-12 12:15:17 -0800 |
|---|---|---|
| committer | Matt Corallo <[email protected]> | 2017-01-12 12:15:17 -0800 |
| commit | 73666ad05932429c860efe74eb388d212c152fc4 (patch) | |
| tree | 15795c38b74233884d446093cfadb69084cea94b /src/validation.cpp | |
| parent | Call ActivateBestChain without cs_main/with most_recent_block (diff) | |
| download | discoin-73666ad05932429c860efe74eb388d212c152fc4.tar.xz discoin-73666ad05932429c860efe74eb388d212c152fc4.zip | |
Add comment to describe callers to ActivateBestChain
Diffstat (limited to 'src/validation.cpp')
| -rw-r--r-- | src/validation.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/validation.cpp b/src/validation.cpp index 5f0cf10ce..a26426be5 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -2388,6 +2388,11 @@ static void NotifyHeaderTip() { * that is already loaded (to avoid loading it again from disk). */ bool ActivateBestChain(CValidationState &state, const CChainParams& chainparams, std::shared_ptr<const CBlock> pblock) { + // Note that while we're often called here from ProcessNewBlock, this is + // far from a guarantee. Things in the P2P/RPC will often end up calling + // us in the middle of ProcessNewBlock - do not assume pblock is set + // sanely for performance or correctness! + CBlockIndex *pindexMostWork = NULL; CBlockIndex *pindexNewTip = NULL; do { |