Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix double-counting in coinbase tx sum #151

Merged
merged 1 commit into from
Apr 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/cryptonote_core/cryptonote_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1767,7 +1767,7 @@ namespace cryptonote
emission_amount = m_coinbase_cache.emissions;
total_fee_amount = m_coinbase_cache.fees;
burnt_beldex = m_coinbase_cache.burnt;
start_offset = m_coinbase_cache.height;
start_offset = m_coinbase_cache.height + 1;
count -= m_coinbase_cache.height;
}
// else don't change anything; we need a subset of blocks that ends before the cache.
Expand Down Expand Up @@ -1798,7 +1798,7 @@ namespace cryptonote
total_fee_amount = m_coinbase_cache.fees;
burnt_beldex = m_coinbase_cache.burnt;
count -= m_coinbase_cache.height - start_offset;
start_offset = m_coinbase_cache.height;
start_offset = m_coinbase_cache.height + 1;
}
}
if (cache_to > 0 && count > CACHE_EXCLUSIVE) {
Expand All @@ -1809,7 +1809,7 @@ namespace cryptonote
}
}

const uint64_t end = start_offset + count - 1;
const uint64_t end = start_offset + count - 2;
m_blockchain_storage.for_blocks_range(start_offset, end,
[this, &cache_to, &result, &cache_build_started](uint64_t height, const crypto::hash& hash, const block& b){
auto& [emission_amount, total_fee_amount, burnt_beldex] = *result;
Expand Down
Loading