From 54e4c0be8f14e9bd4c8450993e6de1c2b12598f0 Mon Sep 17 00:00:00 2001 From: rkrux Date: Mon, 20 Apr 2026 19:09:14 +0530 Subject: [PATCH] wallet: remove update argument from RescanFromTime method Its only usage passes true. --- src/wallet/rpc/backup.cpp | 2 +- src/wallet/wallet.cpp | 4 ++-- src/wallet/wallet.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wallet/rpc/backup.cpp b/src/wallet/rpc/backup.cpp index 4b87ba23238..7f3871adf3c 100644 --- a/src/wallet/rpc/backup.cpp +++ b/src/wallet/rpc/backup.cpp @@ -407,7 +407,7 @@ RPCMethod importdescriptors() // Rescan the blockchain using the lowest timestamp if (rescan) { - int64_t scanned_time = pwallet->RescanFromTime(lowest_timestamp, reserver, /*update=*/true); + int64_t scanned_time = pwallet->RescanFromTime(lowest_timestamp, reserver); pwallet->ResubmitWalletTransactions(node::TxBroadcast::MEMPOOL_NO_BROADCAST, /*force=*/true); if (pwallet->IsAbortingRescan()) { diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 1b8f547f903..13c06f857d6 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -1824,7 +1824,7 @@ void CWallet::MaybeUpdateBirthTime(int64_t time) * @return Earliest timestamp that could be successfully scanned from. Timestamp * returned will be higher than startTime if relevant blocks could not be read. */ -int64_t CWallet::RescanFromTime(int64_t startTime, const WalletRescanReserver& reserver, bool update) +int64_t CWallet::RescanFromTime(int64_t startTime, const WalletRescanReserver& reserver) { // Find starting block. May be null if nCreateTime is greater than the // highest blockchain timestamp, in which case there is nothing that needs @@ -1836,7 +1836,7 @@ int64_t CWallet::RescanFromTime(int64_t startTime, const WalletRescanReserver& r if (start) { // TODO: this should take into account failure by ScanResult::USER_ABORT - ScanResult result = ScanForWalletTransactions(start_block, start_height, /*max_height=*/{}, reserver, /*fUpdate=*/update, /*save_progress=*/false); + ScanResult result = ScanForWalletTransactions(start_block, start_height, /*max_height=*/{}, reserver, /*fUpdate=*/true, /*save_progress=*/false); if (result.status == ScanResult::FAILURE) { int64_t time_max; CHECK_NONFATAL(chain().findBlock(result.last_failed_block, FoundBlock().maxTime(time_max))); diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index 45b9b8abb12..73736ce6d19 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -628,7 +628,7 @@ public: void blockConnected(const kernel::ChainstateRole& role, const interfaces::BlockInfo& block) override; void blockDisconnected(const interfaces::BlockInfo& block) override; void updatedBlockTip() override; - int64_t RescanFromTime(int64_t startTime, const WalletRescanReserver& reserver, bool update); + int64_t RescanFromTime(int64_t startTime, const WalletRescanReserver& reserver); struct ScanResult { enum { SUCCESS, FAILURE, USER_ABORT } status = SUCCESS;