diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-11-04 16:14:50 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-11-04 16:18:15 +0100 |
commit | 06037f3f46463e65ab74e0f34ba5f7a869d053fd (patch) | |
tree | 398bb1aa204787adab42b54dc5ccfe982d5c6419 /src/init.cpp | |
parent | 70d80cc7bf89211a5aa157cb624fff3b7097c48e (diff) | |
parent | af82884ab7c485c8b4c5ac93c308127c39c196be (diff) |
Merge pull request #5007
af82884 Add "warmup mode" for RPC server. (Daniel Kraft)
Diffstat (limited to 'src/init.cpp')
-rw-r--r-- | src/init.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/init.cpp b/src/init.cpp index d622af69ef..fe58c68fda 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -752,6 +752,17 @@ bool AppInit2(boost::thread_group& threadGroup) threadGroup.create_thread(&ThreadScriptCheck); } + /* Start the RPC server already. It will be started in "warmup" mode + * and not really process calls already (but it will signify connections + * that the server is there and will be ready later). Warmup mode will + * be disabled when initialisation is finished. + */ + if (fServer) + { + uiInterface.InitMessage.connect(SetRPCWarmupStatus); + StartRPCThreads(); + } + int64_t nStart; // ********************************************************* Step 5: verify wallet database integrity @@ -1248,8 +1259,6 @@ bool AppInit2(boost::thread_group& threadGroup) #endif StartNode(threadGroup); - if (fServer) - StartRPCThreads(); #ifdef ENABLE_WALLET // Generate coins in the background @@ -1259,6 +1268,7 @@ bool AppInit2(boost::thread_group& threadGroup) // ********************************************************* Step 11: finished + SetRPCWarmupFinished(); uiInterface.InitMessage(_("Done loading")); #ifdef ENABLE_WALLET |