mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-18 13:17:55 +02: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:
parent
935c6c4b23
commit
3449880b49
3 changed files with 14 additions and 4 deletions
|
|
@ -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,10 +1849,16 @@ 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) {
|
||||
result.last_scanned_block = block_hash;
|
||||
result.last_scanned_height = block_height;
|
||||
fetch_block = false;
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue