mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-16 07:33:20 +01:00
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.
This commit is contained in:
@@ -52,6 +52,7 @@ enum RPCErrorCode
|
||||
RPC_VERIFY_ERROR = -25, // General error during transaction or block submission
|
||||
RPC_VERIFY_REJECTED = -26, // Transaction or block was rejected by network rules
|
||||
RPC_VERIFY_ALREADY_IN_CHAIN = -27, // Transaction already in chain
|
||||
RPC_IN_WARMUP = -28, // Client still warming up
|
||||
|
||||
// Aliases for backward compatibility
|
||||
RPC_TRANSACTION_ERROR = RPC_VERIFY_ERROR,
|
||||
|
||||
Reference in New Issue
Block a user