Add RAII wallet rescan reserver
This commit is contained in:
@@ -3398,7 +3398,8 @@ UniValue rescanblockchain(const JSONRPCRequest& request)
|
||||
);
|
||||
}
|
||||
|
||||
if (pwallet->IsScanning()) {
|
||||
WalletRescanReserver reserver(pwallet);
|
||||
if (!reserver.reserve()) {
|
||||
throw JSONRPCError(RPC_WALLET_ERROR, "Wallet is currently rescanning. Abort existing rescan or wait.");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user