aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/rpc/backup.cpp
diff options
context:
space:
mode:
authorstickies-v <stickies-v@protonmail.com>2022-09-27 19:21:51 +0100
committerfanquake <fanquake@gmail.com>2022-10-13 23:36:13 +0800
commita6fb674f966df27c09dc3d2b81040ce2965b2d7e (patch)
tree0123b3909261cc80d0a87ce659bec6e453e8de07 /src/wallet/rpc/backup.cpp
parent5ad82a09b409d416236092062a4201e238dfd68b (diff)
downloadbitcoin-a6fb674f966df27c09dc3d2b81040ce2965b2d7e.tar.xz
refactor: remove unused locks for ResubmitWalletTransactions
ReacceptWalletTransactions is replaced by ResubmitWalletTransactions which already handles acquiring the necessary locks internally. Github-Pull: #26205 Rebased-From: 01f3534632d18c772901fb6ce22f6394eae96799
Diffstat (limited to 'src/wallet/rpc/backup.cpp')
-rw-r--r--src/wallet/rpc/backup.cpp20
1 files changed, 4 insertions, 16 deletions
diff --git a/src/wallet/rpc/backup.cpp b/src/wallet/rpc/backup.cpp
index 35df151e84..a971331a70 100644
--- a/src/wallet/rpc/backup.cpp
+++ b/src/wallet/rpc/backup.cpp
@@ -293,10 +293,7 @@ RPCHelpMan importaddress()
if (fRescan)
{
RescanWallet(*pwallet, reserver);
- {
- LOCK(pwallet->cs_wallet);
- pwallet->ResubmitWalletTransactions(/*relay=*/false, /*force=*/true);
- }
+ pwallet->ResubmitWalletTransactions(/*relay=*/false, /*force=*/true);
}
return UniValue::VNULL;
@@ -474,10 +471,7 @@ RPCHelpMan importpubkey()
if (fRescan)
{
RescanWallet(*pwallet, reserver);
- {
- LOCK(pwallet->cs_wallet);
- pwallet->ResubmitWalletTransactions(/*relay=*/false, /*force=*/true);
- }
+ pwallet->ResubmitWalletTransactions(/*relay=*/false, /*force=*/true);
}
return UniValue::VNULL;
@@ -1395,10 +1389,7 @@ RPCHelpMan importmulti()
}
if (fRescan && fRunScan && requests.size()) {
int64_t scannedTime = pwallet->RescanFromTime(nLowestTimestamp, reserver, true /* update */);
- {
- LOCK(pwallet->cs_wallet);
- pwallet->ResubmitWalletTransactions(/*relay=*/false, /*force=*/true);
- }
+ pwallet->ResubmitWalletTransactions(/*relay=*/false, /*force=*/true);
if (pwallet->IsAbortingRescan()) {
throw JSONRPCError(RPC_MISC_ERROR, "Rescan aborted by user.");
@@ -1689,10 +1680,7 @@ RPCHelpMan importdescriptors()
// Rescan the blockchain using the lowest timestamp
if (rescan) {
int64_t scanned_time = pwallet->RescanFromTime(lowest_timestamp, reserver, true /* update */);
- {
- LOCK(pwallet->cs_wallet);
- pwallet->ResubmitWalletTransactions(/*relay=*/false, /*force=*/true);
- }
+ pwallet->ResubmitWalletTransactions(/*relay=*/false, /*force=*/true);
if (pwallet->IsAbortingRescan()) {
throw JSONRPCError(RPC_MISC_ERROR, "Rescan aborted by user.");