Browse Source

Ensure that no tracked blocks are skipped during orphan detection

pull/4/head
Jack Grigg 8 years ago
parent
commit
73a439185d
No known key found for this signature in database GPG Key ID: 6A6914DAFBEA00DA
  1. 4
      src/metrics.cpp

4
src/metrics.cpp

@ -165,7 +165,8 @@ int printMetrics(size_t cols, int64_t nStart, bool mining)
auto tipHeight = chainActive.Height();
// Update orphans and calculate subsidies
for (std::list<uint256>::iterator it = u->begin(); it != u->end(); it++) {
std::list<uint256>::iterator it = u->begin();
while (it != u->end()) {
auto hash = *it;
if (mapBlockIndex.count(hash) > 0 &&
chainActive.Contains(mapBlockIndex[hash])) {
@ -179,6 +180,7 @@ int printMetrics(size_t cols, int64_t nStart, bool mining)
} else {
mature += subsidy;
}
it++;
} else {
it = u->erase(it);
}

Loading…
Cancel
Save