mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-18 22:35:39 +01:00
getblocktemplate: longpolling support
This commit is contained in:
committed by
Wladimir J. van der Laan
parent
f0fc81a083
commit
ff6a7af154
@@ -41,6 +41,8 @@ CCriticalSection cs_main;
|
||||
map<uint256, CBlockIndex*> mapBlockIndex;
|
||||
CChain chainActive;
|
||||
int64_t nTimeBestReceived = 0;
|
||||
CWaitableCriticalSection csBestBlock;
|
||||
CConditionVariable cvBlockChange;
|
||||
int nScriptCheckThreads = 0;
|
||||
bool fImporting = false;
|
||||
bool fReindex = false;
|
||||
@@ -1944,11 +1946,14 @@ void static UpdateTip(CBlockIndex *pindexNew) {
|
||||
// New best block
|
||||
nTimeBestReceived = GetTime();
|
||||
mempool.AddTransactionsUpdated(1);
|
||||
|
||||
LogPrintf("UpdateTip: new best=%s height=%d log2_work=%.8g tx=%lu date=%s progress=%f\n",
|
||||
chainActive.Tip()->GetBlockHash().ToString(), chainActive.Height(), log(chainActive.Tip()->nChainWork.getdouble())/log(2.0), (unsigned long)chainActive.Tip()->nChainTx,
|
||||
DateTimeStrFormat("%Y-%m-%d %H:%M:%S", chainActive.Tip()->GetBlockTime()),
|
||||
Checkpoints::GuessVerificationProgress(chainActive.Tip()));
|
||||
|
||||
cvBlockChange.notify_all();
|
||||
|
||||
// Check the version of the last 100 blocks to see if we need to upgrade:
|
||||
if (!fIsInitialDownload)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user