Skip to content

Commit f138566

Browse files
committed
Wallet: avoid scanning after the last known block
1 parent 117b387 commit f138566

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/wallet/wallet.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1689,6 +1689,11 @@ CWallet::ScanResult CWallet::ScanForWalletTransactions(const uint256& start_bloc
16891689
if (max_height && block_height >= *max_height) {
16901690
break;
16911691
}
1692+
if (block_height >= WITH_LOCK(cs_wallet, return GetLastBlockHeight())) {
1693+
WalletLogPrintf("Stopping scan. At block %d. Progress=%f\n", block_height, progress_current);
1694+
break;
1695+
}
1696+
16921697
{
16931698
if (!next_block) {
16941699
// break successfully when rescan has reached the tip, or

0 commit comments

Comments
 (0)