Skip to content

Commit bb24d68

Browse files
committed
Make CWallet::ScanForWalletTransactions args and return value const
1 parent 47ed24c commit bb24d68

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/wallet/rpcwallet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3332,7 +3332,7 @@ UniValue rescanblockchain(const JSONRPCRequest& request)
33323332
}
33333333
}
33343334

3335-
CBlockIndex *stopBlock = pwallet->ScanForWalletTransactions(pindexStart, pindexStop, reserver, true);
3335+
const CBlockIndex* stopBlock = pwallet->ScanForWalletTransactions(pindexStart, pindexStop, reserver, true);
33363336
if (!stopBlock) {
33373337
if (pwallet->IsAbortingRescan()) {
33383338
throw JSONRPCError(RPC_MISC_ERROR, "Rescan aborted.");

src/wallet/wallet.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1637,7 +1637,7 @@ int64_t CWallet::RescanFromTime(int64_t startTime, const WalletRescanReserver& r
16371637
* the main chain after to the addition of any new keys you want to detect
16381638
* transactions for.
16391639
*/
1640-
CBlockIndex* CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, CBlockIndex* pindexStop, const WalletRescanReserver &reserver, bool fUpdate)
1640+
const CBlockIndex* CWallet::ScanForWalletTransactions(const CBlockIndex* const pindexStart, const CBlockIndex* const pindexStop, const WalletRescanReserver& reserver, bool fUpdate)
16411641
{
16421642
int64_t nNow = GetTime();
16431643
const CChainParams& chainParams = Params();
@@ -1647,8 +1647,8 @@ CBlockIndex* CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, CBlock
16471647
assert(pindexStop->nHeight >= pindexStart->nHeight);
16481648
}
16491649

1650-
CBlockIndex* pindex = pindexStart;
1651-
CBlockIndex* ret = nullptr;
1650+
const CBlockIndex* pindex = pindexStart;
1651+
const CBlockIndex* ret = nullptr;
16521652

16531653
if (pindex) WalletLogPrintf("Rescan started from block %d...\n", pindex->nHeight);
16541654

src/wallet/wallet.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,7 @@ class CWallet final : public CCryptoKeyStore, public CValidationInterface
896896
void BlockConnected(const std::shared_ptr<const CBlock>& pblock, const CBlockIndex *pindex, const std::vector<CTransactionRef>& vtxConflicted) override;
897897
void BlockDisconnected(const std::shared_ptr<const CBlock>& pblock) override;
898898
int64_t RescanFromTime(int64_t startTime, const WalletRescanReserver& reserver, bool update);
899-
CBlockIndex* ScanForWalletTransactions(CBlockIndex* pindexStart, CBlockIndex* pindexStop, const WalletRescanReserver& reserver, bool fUpdate = false);
899+
const CBlockIndex* ScanForWalletTransactions(const CBlockIndex* const pindexStart, const CBlockIndex* const pindexStop, const WalletRescanReserver& reserver, bool fUpdate = false);
900900
void TransactionRemovedFromMempool(const CTransactionRef &ptx) override;
901901
void ReacceptWalletTransactions();
902902
void ResendWalletTransactions(int64_t nBestBlockTime, CConnman* connman) override EXCLUSIVE_LOCKS_REQUIRED(cs_main);

0 commit comments

Comments
 (0)