Skip to content

Commit

Permalink
Move nTimeBestReceived updating into net processing code
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBlueMatt committed Oct 31, 2016
1 parent d8670fb commit f5b960b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ CCriticalSection cs_main;
BlockMap mapBlockIndex;
CChain chainActive;
CBlockIndex *pindexBestHeader = NULL;
int64_t nTimeBestReceived = 0;
int64_t nTimeBestReceived = 0; // Used only to inform the wallet of when we last received a block
CWaitableCriticalSection csBestBlock;
CConditionVariable cvBlockChange;
int nScriptCheckThreads = 0;
Expand Down Expand Up @@ -2690,7 +2690,6 @@ void static UpdateTip(CBlockIndex *pindexNew, const CChainParams& chainParams) {
chainActive.SetTip(pindexNew);

// New best block
nTimeBestReceived = GetTime();
mempool.AddTransactionsUpdated(1);

cvBlockChange.notify_all();
Expand Down Expand Up @@ -4736,6 +4735,8 @@ void PeerLogicValidation::UpdatedBlockTip(const CBlockIndex *pindexNew, const CB
}
});
}

nTimeBestReceived = GetTime();
}

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

0 comments on commit f5b960b

Please sign in to comment.