diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2016-09-09 08:33:26 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2016-09-09 08:33:54 +0200 |
commit | 666eaf03cf251832302fa5d358b1a6ca128db7e8 (patch) | |
tree | 77ba58aef22802188b1fe687ffc18b5bd289e739 /src/init.cpp | |
parent | 80a4f21d377a8120190dd0a88be364e71607157c (diff) | |
parent | d6a5dc4a2eaa0d7348804254ca09e75fc3a858ab (diff) |
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 27843fa882..64e161b9b2 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. " |