diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -4092,7 +4092,7 @@ } } - CBlockIndex *stopBlock = pwallet->ScanForWalletTransactions( + const CBlockIndex *stopBlock = pwallet->ScanForWalletTransactions( pindexStart, pindexStop, reserver, true); if (!stopBlock) { if (pwallet->IsAbortingRescan()) { diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -1062,10 +1062,11 @@ BlockDisconnected(const std::shared_ptr &pblock) override; int64_t RescanFromTime(int64_t startTime, const WalletRescanReserver &reserver, bool update); - CBlockIndex *ScanForWalletTransactions(CBlockIndex *pindexStart, - CBlockIndex *pindexStop, - const WalletRescanReserver &reserver, - bool fUpdate = false); + const CBlockIndex * + ScanForWalletTransactions(const CBlockIndex *const pindexStart, + const CBlockIndex *const pindexStop, + const WalletRescanReserver &reserver, + bool fUpdate = false); void TransactionRemovedFromMempool(const CTransactionRef &ptx) override; void ReacceptWalletTransactions(); void ResendWalletTransactions(int64_t nBestBlockTime, diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -1827,8 +1827,8 @@ * the main chain after to the addition of any new keys you want to detect * transactions for. */ -CBlockIndex *CWallet::ScanForWalletTransactions( - CBlockIndex *pindexStart, CBlockIndex *pindexStop, +const CBlockIndex *CWallet::ScanForWalletTransactions( + const CBlockIndex *const pindexStart, const CBlockIndex *const pindexStop, const WalletRescanReserver &reserver, bool fUpdate) { int64_t nNow = GetTime(); @@ -1837,8 +1837,8 @@ assert(pindexStop->nHeight >= pindexStart->nHeight); } - CBlockIndex *pindex = pindexStart; - CBlockIndex *ret = nullptr; + const CBlockIndex *pindex = pindexStart; + const CBlockIndex *ret = nullptr; if (pindex) { WalletLogPrintf("Rescan started from block %d...\n", pindex->nHeight);