aboutsummaryrefslogtreecommitdiff
path: root/src/rpcserver.h
diff options
context:
space:
mode:
authorDaniel Kraft <d@domob.eu>2014-10-29 18:08:31 +0100
committerDaniel Kraft <d@domob.eu>2014-11-04 16:01:09 +0100
commitaf82884ab7c485c8b4c5ac93c308127c39c196be (patch)
tree766428da14b53e4902c87fd3fb05a1c0d1acd87a /src/rpcserver.h
parentbe32b5212b6ab4460080ec5ff55e2bf882259e5e (diff)
downloadbitcoin-af82884ab7c485c8b4c5ac93c308127c39c196be.tar.xz
Add "warmup mode" for RPC server.
Start the RPC server before doing all the (expensive) startup initialisations like loading the block index. Until the node is ready, return all calls immediately with a new error signalling "in warmup" with an appropriate status message (similar to the init message). This is useful for RPC clients to know that the server is there (e. g., they don't have to start it) but not yet available. It is used in Namecoin and Huntercoin already for some time, and there exists a UI hooked onto the RPC interface that actively uses this to its advantage.
Diffstat (limited to 'src/rpcserver.h')
-rw-r--r--src/rpcserver.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/rpcserver.h b/src/rpcserver.h
index 2f34b11d22..2a258dd89a 100644
--- a/src/rpcserver.h
+++ b/src/rpcserver.h
@@ -45,6 +45,13 @@ void StopRPCThreads();
/* Query whether RPC is running */
bool IsRPCRunning();
+/* Set the RPC warmup status. When this is done, all RPC calls will error out
+ * immediately with RPC_IN_WARMUP.
+ */
+void SetRPCWarmupStatus(const std::string& newStatus);
+/* Mark warmup as done. RPC calls will be processed from now on. */
+void SetRPCWarmupFinished();
+
/**
* Type-check arguments; throws JSONRPCError if wrong type given. Does not check that
* the right number of arguments are passed, just that any passed are the correct type.