aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/rpcwallet.cpp
diff options
context:
space:
mode:
authorJonas Schnelli <dev@jonasschnelli.ch>2017-12-08 11:07:37 -1000
committerJonas Schnelli <dev@jonasschnelli.ch>2018-01-23 20:23:57 -1000
commitdbf8556b4d6a2484ad4c03d0b4e41c1db0133997 (patch)
treec955e1bea937c2901267cdbc191bde93db725e22 /src/wallet/rpcwallet.cpp
parent8d0b610fe8d0916404aa9158c525b80b1c581c0e (diff)
Add RAII wallet rescan reserver
Diffstat (limited to 'src/wallet/rpcwallet.cpp')
-rw-r--r--src/wallet/rpcwallet.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp
index bc0d544aab..50642e6b8a 100644
--- a/src/wallet/rpcwallet.cpp
+++ b/src/wallet/rpcwallet.cpp
@@ -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.");
}