mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
wallet: fast rescan: show log message for every non-skipped block
For that purpose, a new logging category BCLog::SCAN is introduced.
This commit is contained in:
@@ -181,6 +181,7 @@ const CLogCategoryDesc LogCategories[] =
|
||||
{BCLog::UTIL, "util"},
|
||||
{BCLog::BLOCKSTORE, "blockstorage"},
|
||||
{BCLog::TXRECONCILIATION, "txreconciliation"},
|
||||
{BCLog::SCAN, "scan"},
|
||||
{BCLog::ALL, "1"},
|
||||
{BCLog::ALL, "all"},
|
||||
};
|
||||
@@ -283,6 +284,8 @@ std::string LogCategoryToStr(BCLog::LogFlags category)
|
||||
return "blockstorage";
|
||||
case BCLog::LogFlags::TXRECONCILIATION:
|
||||
return "txreconciliation";
|
||||
case BCLog::LogFlags::SCAN:
|
||||
return "scan";
|
||||
case BCLog::LogFlags::ALL:
|
||||
return "all";
|
||||
}
|
||||
|
||||
@@ -67,6 +67,7 @@ namespace BCLog {
|
||||
UTIL = (1 << 25),
|
||||
BLOCKSTORE = (1 << 26),
|
||||
TXRECONCILIATION = (1 << 27),
|
||||
SCAN = (1 << 28),
|
||||
ALL = ~(uint32_t)0,
|
||||
};
|
||||
enum class Level {
|
||||
|
||||
@@ -1849,11 +1849,17 @@ CWallet::ScanResult CWallet::ScanForWalletTransactions(const uint256& start_bloc
|
||||
if (fast_rescan_filter) {
|
||||
fast_rescan_filter->UpdateIfNeeded();
|
||||
auto matches_block{fast_rescan_filter->MatchesBlock(block_hash)};
|
||||
if (matches_block.has_value() && !*matches_block) {
|
||||
if (matches_block.has_value()) {
|
||||
if (*matches_block) {
|
||||
LogPrint(BCLog::SCAN, "Fast rescan: inspect block %d [%s] (filter matched)\n", block_height, block_hash.ToString());
|
||||
} else {
|
||||
result.last_scanned_block = block_hash;
|
||||
result.last_scanned_height = block_height;
|
||||
fetch_block = false;
|
||||
}
|
||||
} else {
|
||||
LogPrint(BCLog::SCAN, "Fast rescan: inspect block %d [%s] (WARNING: block filter not found!)\n", block_height, block_hash.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
// Find next block separately from reading data above, because reading
|
||||
|
||||
Reference in New Issue
Block a user