Skip to content

Commit 6ad372a

Browse files
committed
wallet: log on rescan completion
1 parent 3356799 commit 6ad372a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/wallet/wallet.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1771,6 +1771,7 @@ int64_t CWallet::RescanFromTime(int64_t startTime, const WalletRescanReserver& r
17711771
CWallet::ScanResult CWallet::ScanForWalletTransactions(const uint256& start_block, const uint256& stop_block, const WalletRescanReserver& reserver, bool fUpdate)
17721772
{
17731773
int64_t nNow = GetTime();
1774+
int64_t start_time = GetTimeMillis();
17741775

17751776
assert(reserver.isReserved());
17761777

@@ -1862,6 +1863,8 @@ CWallet::ScanResult CWallet::ScanForWalletTransactions(const uint256& start_bloc
18621863
} else if (block_height && chain().shutdownRequested()) {
18631864
WalletLogPrintf("Rescan interrupted by shutdown request at block %d. Progress=%f\n", *block_height, progress_current);
18641865
result.status = ScanResult::USER_ABORT;
1866+
} else {
1867+
WalletLogPrintf("Rescan completed in %15dms\n", GetTimeMillis() - start_time);
18651868
}
18661869
}
18671870
return result;
@@ -4245,15 +4248,13 @@ std::shared_ptr<CWallet> CWallet::CreateWalletFromFile(interfaces::Chain& chain,
42454248
}
42464249
}
42474250

4248-
nStart = GetTimeMillis();
42494251
{
42504252
WalletRescanReserver reserver(walletInstance.get());
42514253
if (!reserver.reserve() || (ScanResult::SUCCESS != walletInstance->ScanForWalletTransactions(locked_chain->getBlockHash(rescan_height), {} /* stop block */, reserver, true /* update */).status)) {
42524254
chain.initError(_("Failed to rescan the wallet during initialization"));
42534255
return nullptr;
42544256
}
42554257
}
4256-
walletInstance->WalletLogPrintf("Rescan completed in %15dms\n", GetTimeMillis() - nStart);
42574258
walletInstance->ChainStateFlushed(locked_chain->getTipLocator());
42584259
walletInstance->database->IncrementUpdateCounter();
42594260

0 commit comments

Comments
 (0)