Skip to content

Commit 5a1b1e2

Browse files
committed
refactor: move verification progress log out of VerifySnapshotPair
1 parent 829c3a1 commit 5a1b1e2

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-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) {
@@ -1737,14 +1743,8 @@ std::vector<const CBlockIndex*> CDeterministicMNManager::CollectSnapshotBlocks(
17371743

17381744
bool CDeterministicMNManager::VerifySnapshotPair(
17391745
const CBlockIndex* from_index, const CBlockIndex* to_index, const CDeterministicMNList& from_snapshot,
1740-
const CDeterministicMNList& to_snapshot, RecalcDiffsResult& result, size_t pair_index, size_t total_pairs)
1746+
const CDeterministicMNList& to_snapshot, RecalcDiffsResult& result)
17411747
{
1742-
// Log progress periodically (every 100 snapshot pairs) to avoid spam
1743-
if (pair_index % 100 == 0) {
1744-
LogPrintf("CDeterministicMNManager::%s -- Progress: verifying snapshot pair %d/%d (heights %d-%d)\n",
1745-
__func__, pair_index + 1, total_pairs, from_index->nHeight, to_index->nHeight);
1746-
}
1747-
17481748
// Verify this snapshot pair by applying all stored diffs sequentially
17491749
CDeterministicMNList test_list = from_snapshot;
17501750

src/evo/deterministicmns.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -757,8 +757,7 @@ class CDeterministicMNManager
757757
std::vector<const CBlockIndex*> CollectSnapshotBlocks(const CBlockIndex* start_index, const CBlockIndex* stop_index,
758758
const Consensus::Params& consensus_params);
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);
760+
const CDeterministicMNList& to_snapshot, RecalcDiffsResult& result);
762761
std::vector<std::pair<uint256, CDeterministicMNListDiff>> RepairSnapshotPair(
763762
const CBlockIndex* from_index, const CBlockIndex* to_index, const CDeterministicMNList& from_snapshot,
764763
const CDeterministicMNList& to_snapshot, BuildListFromBlockFunc build_list_func, RecalcDiffsResult& result)

0 commit comments

Comments
 (0)