diff options
| author | Wladimir J. van der Laan <[email protected]> | 2014-07-14 08:20:46 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2014-07-14 08:29:46 +0200 |
| commit | 3554df9b99e87796e320ce7121594935f6de8617 (patch) | |
| tree | c0ac2b867a47e9b56db77538b339ff4a482650fe /src/main.cpp | |
| parent | Merge pull request #4510 (diff) | |
| parent | Add test for getblocktemplate longpolling (diff) | |
| download | discoin-3554df9b99e87796e320ce7121594935f6de8617.tar.xz discoin-3554df9b99e87796e320ce7121594935f6de8617.zip | |
Merge pull request #4503
b45a6e8 Add test for getblocktemplate longpolling (Wladimir J. van der Laan)
ff6a7af getblocktemplate: longpolling support (Luke Dashjr)
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp index a9c080ffa..9e97a9168 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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) { |