Skip to content

Commit f5b960b

Browse files
committed
Move nTimeBestReceived updating into net processing code
1 parent d8670fb commit f5b960b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ CCriticalSection cs_main;
6363
BlockMap mapBlockIndex;
6464
CChain chainActive;
6565
CBlockIndex *pindexBestHeader = NULL;
66-
int64_t nTimeBestReceived = 0;
66+
int64_t nTimeBestReceived = 0; // Used only to inform the wallet of when we last received a block
6767
CWaitableCriticalSection csBestBlock;
6868
CConditionVariable cvBlockChange;
6969
int nScriptCheckThreads = 0;
@@ -2690,7 +2690,6 @@ void static UpdateTip(CBlockIndex *pindexNew, const CChainParams& chainParams) {
26902690
chainActive.SetTip(pindexNew);
26912691

26922692
// New best block
2693-
nTimeBestReceived = GetTime();
26942693
mempool.AddTransactionsUpdated(1);
26952694

26962695
cvBlockChange.notify_all();
@@ -4736,6 +4735,8 @@ void PeerLogicValidation::UpdatedBlockTip(const CBlockIndex *pindexNew, const CB
47364735
}
47374736
});
47384737
}
4738+
4739+
nTimeBestReceived = GetTime();
47394740
}
47404741

47414742
void PeerLogicValidation::BlockChecked(const CBlock& block, const CValidationState& state) {

0 commit comments

Comments
 (0)