mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
rpc: Push down safe mode checks
This contains most of the changes of 10563 "remove safe mode", but doesn't remove the safe mode yet, but put an `ObserveSafeMode()` check in individual calls with okSafeMode=false. This cleans up the ugly "okSafeMode" flag from the dispatch tables, which is not a concern for the RPC server. Extra-author: Wladimir J. van der Laan <laanwj@gmail.com>
This commit is contained in:
committed by
Wladimir J. van der Laan
parent
cee4fe1d53
commit
ec6902d0ea
@@ -4,6 +4,7 @@
|
||||
|
||||
#include "base58.h"
|
||||
#include "chain.h"
|
||||
#include "rpc/safemode.h"
|
||||
#include "rpc/server.h"
|
||||
#include "init.h"
|
||||
#include "validation.h"
|
||||
@@ -174,6 +175,7 @@ UniValue abortrescan(const JSONRPCRequest& request)
|
||||
+ HelpExampleRpc("abortrescan", "")
|
||||
);
|
||||
|
||||
ObserveSafeMode();
|
||||
if (!pwallet->IsScanning() || pwallet->IsAbortingRescan()) return false;
|
||||
pwallet->AbortRescan();
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user