aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastian Falbesoner <sebastian.falbesoner@gmail.com>2022-10-01 12:23:59 +0200
committerSebastian Falbesoner <sebastian.falbesoner@gmail.com>2022-10-25 15:57:38 +0200
commit3449880b499d54bfbcf6caeed52851ce55259ed7 (patch)
tree2bc425f70886fe8c8cf3803a00784516db2138a4 /src
parent935c6c4b234bbb0565cda6f58ee298048856acae (diff)
downloadbitcoin-3449880b499d54bfbcf6caeed52851ce55259ed7.tar.xz
wallet: fast rescan: show log message for every non-skipped block
For that purpose, a new logging category BCLog::SCAN is introduced.
Diffstat (limited to 'src')
-rw-r--r--src/logging.cpp3
-rw-r--r--src/logging.h1
-rw-r--r--src/wallet/wallet.cpp14
3 files changed, 14 insertions, 4 deletions
diff --git a/src/logging.cpp b/src/logging.cpp
index c95c0b7e37..ed0c2a56a5 100644
--- a/src/logging.cpp
+++ b/src/logging.cpp
@@ -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";
}
diff --git a/src/logging.h b/src/logging.h
index 5ee6665c76..14a0f08f8d 100644
--- a/src/logging.h
+++ b/src/logging.h
@@ -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 {
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index 912f995ca2..560058af03 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -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());
}
}