diff options
-rw-r--r-- | src/logging.cpp | 3 | ||||
-rw-r--r-- | src/logging.h | 1 | ||||
-rw-r--r-- | src/wallet/wallet.cpp | 14 |
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()); } } |