Add RAII wallet rescan reserver

This commit is contained in:
Jonas Schnelli
2017-12-08 11:07:37 -10:00
parent 8d0b610fe8
commit dbf8556b4d
3 changed files with 55 additions and 1 deletions
+2 -1
View File
@@ -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.");
}