Skip to content

Commit 73666ad

Browse files
committed
Add comment to describe callers to ActivateBestChain
1 parent 962f7f0 commit 73666ad

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/validation.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2388,6 +2388,11 @@ static void NotifyHeaderTip() {
23882388
* that is already loaded (to avoid loading it again from disk).
23892389
*/
23902390
bool ActivateBestChain(CValidationState &state, const CChainParams& chainparams, std::shared_ptr<const CBlock> pblock) {
2391+
// Note that while we're often called here from ProcessNewBlock, this is
2392+
// far from a guarantee. Things in the P2P/RPC will often end up calling
2393+
// us in the middle of ProcessNewBlock - do not assume pblock is set
2394+
// sanely for performance or correctness!
2395+
23912396
CBlockIndex *pindexMostWork = NULL;
23922397
CBlockIndex *pindexNewTip = NULL;
23932398
do {

0 commit comments

Comments
 (0)