Allow help, z_listaddresses, listaddresses, z_exportkey and dumpprivkey during RPC warmup
This commit is contained in:
@@ -825,9 +825,13 @@ UniValue CRPCTable::execute(const std::string &strMethod, const UniValue ¶ms
|
|||||||
{
|
{
|
||||||
LOCK(cs_rpcWarmup);
|
LOCK(cs_rpcWarmup);
|
||||||
if (fRPCInWarmup) {
|
if (fRPCInWarmup) {
|
||||||
// hush-cli stop is the only valid RPC command during warmup
|
// Most RPCs are unsafe to run during warmup, but stop+help are fine
|
||||||
// We don't know if we have valid blocks or wallet yet, nothing else is safe
|
// Others may not have data loaded yet, such as wallet details, but
|
||||||
if (pcmd->name != "stop") {
|
// those RPCs are written defensively to deal with that. Allowing these
|
||||||
|
// few RPCs means we can see our addresses and make private key backups
|
||||||
|
// while a very long wallet rescan is happening
|
||||||
|
if (pcmd->name != "stop" && pcmd->name != "help" && pcmd->name != "z_listaddresses" && pcmd->name != "z_exportkey" &&
|
||||||
|
pcmd->name != "listaddresses" && pcmd->name != "dumpprivkey" ) {
|
||||||
throw JSONRPCError(RPC_IN_WARMUP, rpcWarmupStatus);
|
throw JSONRPCError(RPC_IN_WARMUP, rpcWarmupStatus);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user