Skip to content

Commit f3ee1d7

Browse files
committed
refactor: move verification progress log out of VerifySnapshotPair
1 parent f482f01 commit f3ee1d7

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/evo/deterministicmns.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1661,8 +1661,14 @@ CDeterministicMNManager::RecalcDiffsResult CDeterministicMNManager::RecalculateA
16611661
return result;
16621662
}
16631663

1664+
// Log progress periodically (every 100 snapshot pairs) to avoid spam
1665+
if (i % 100 == 0) {
1666+
LogPrintf("CDeterministicMNManager::%s -- Progress: verifying snapshot pair %d/%d (heights %d-%d)\n",
1667+
__func__, i + 1, snapshot_blocks.size() - 1, from_index->nHeight, to_index->nHeight);
1668+
}
1669+
16641670
// Verify this snapshot pair
1665-
bool is_snapshot_pair_valid = VerifySnapshotPair(from_index, to_index, from_snapshot, to_snapshot, result, i, snapshot_blocks.size() - 1);
1671+
bool is_snapshot_pair_valid = VerifySnapshotPair(from_index, to_index, from_snapshot, to_snapshot, result);
16661672

16671673
// If repair mode is enabled and verification failed, recalculate diffs from blockchain
16681674
if (repair && !is_snapshot_pair_valid) {
@@ -1739,16 +1745,10 @@ std::vector<const CBlockIndex*> CDeterministicMNManager::CollectSnapshotBlocks(
17391745

17401746
bool CDeterministicMNManager::VerifySnapshotPair(
17411747
const CBlockIndex* from_index, const CBlockIndex* to_index, const CDeterministicMNList& from_snapshot,
1742-
const CDeterministicMNList& to_snapshot, RecalcDiffsResult& result, size_t pair_index, size_t total_pairs)
1748+
const CDeterministicMNList& to_snapshot, RecalcDiffsResult& result)
17431749
{
17441750
AssertLockHeld(::cs_main);
17451751

1746-
// Log progress periodically (every 100 snapshot pairs) to avoid spam
1747-
if (pair_index % 100 == 0) {
1748-
LogPrintf("CDeterministicMNManager::%s -- Progress: verifying snapshot pair %d/%d (heights %d-%d)\n",
1749-
__func__, pair_index + 1, total_pairs, from_index->nHeight, to_index->nHeight);
1750-
}
1751-
17521752
// Verify this snapshot pair by applying all stored diffs sequentially
17531753
CDeterministicMNList test_list = from_snapshot;
17541754

src/evo/deterministicmns.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -757,8 +757,8 @@ class CDeterministicMNManager
757757
std::vector<const CBlockIndex*> CollectSnapshotBlocks(const CBlockIndex* start_index, const CBlockIndex* stop_index,
758758
const Consensus::Params& consensus_params) EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
759759
bool VerifySnapshotPair(const CBlockIndex* from_index, const CBlockIndex* to_index, const CDeterministicMNList& from_snapshot,
760-
const CDeterministicMNList& to_snapshot, RecalcDiffsResult& result, size_t pair_index,
761-
size_t total_pairs) EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
760+
const CDeterministicMNList& to_snapshot, RecalcDiffsResult& result)
761+
EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
762762
std::vector<std::pair<uint256, CDeterministicMNListDiff>> RepairSnapshotPair(
763763
const CBlockIndex* from_index, const CBlockIndex* to_index, const CDeterministicMNList& from_snapshot,
764764
const CDeterministicMNList& to_snapshot, BuildListFromBlockFunc build_list_func, RecalcDiffsResult& result)

0 commit comments

Comments
 (0)