diff options
| author | Wladimir J. van der Laan <[email protected]> | 2016-09-09 08:33:26 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2016-09-09 08:33:54 +0200 |
| commit | 666eaf03cf251832302fa5d358b1a6ca128db7e8 (patch) | |
| tree | 77ba58aef22802188b1fe687ffc18b5bd289e739 /src/init.cpp | |
| parent | Merge #8525: Do not store witness txn in rejection cache (diff) | |
| parent | add waitfornewblock/waitforblock/waitforblockheight rpcs and use them for tests (diff) | |
| download | discoin-666eaf03cf251832302fa5d358b1a6ca128db7e8.tar.xz discoin-666eaf03cf251832302fa5d358b1a6ca128db7e8.zip | |
Merge #8680: Address Travis spurious failures
d6a5dc4 add waitfornewblock/waitforblock/waitforblockheight rpcs and use them for tests (Cory Fields)
Diffstat (limited to 'src/init.cpp')
| -rw-r--r-- | src/init.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/init.cpp b/src/init.cpp index 27843fa88..64e161b9b 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -280,9 +280,15 @@ bool static Bind(const CService &addr, unsigned int flags) { } return true; } +void OnRPCStarted() +{ + uiInterface.NotifyBlockTip.connect(&RPCNotifyBlockChange); +} void OnRPCStopped() { + uiInterface.NotifyBlockTip.disconnect(&RPCNotifyBlockChange); + RPCNotifyBlockChange(false, nullptr); cvBlockChange.notify_all(); LogPrint("rpc", "RPC stopped.\n"); } @@ -666,6 +672,7 @@ bool InitSanityCheck(void) bool AppInitServers(boost::thread_group& threadGroup) { + RPCServer::OnStarted(&OnRPCStarted); RPCServer::OnStopped(&OnRPCStopped); RPCServer::OnPreCommand(&OnRPCPreCommand); if (!InitHTTPServer()) @@ -1357,6 +1364,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) { LOCK(cs_main); CBlockIndex* tip = chainActive.Tip(); + RPCNotifyBlockChange(true, tip); if (tip && tip->nTime > GetAdjustedTime() + 2 * 60 * 60) { strLoadError = _("The block database contains a block which appears to be from the future. " "This may be due to your computer's date and time being set incorrectly. " |