From 987c3139dce921c98b4a24bab52354102f21fb1e Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Mon, 9 Dec 2019 14:56:44 +0000 Subject: print_coinbase_tx_sum now supports 128 bits sums The tail emission will bring the total above 64 bits --- src/cryptonote_core/cryptonote_core.cpp | 8 ++++---- src/cryptonote_core/cryptonote_core.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/cryptonote_core') diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp index 02620996e..460ff07d8 100644 --- a/src/cryptonote_core/cryptonote_core.cpp +++ b/src/cryptonote_core/cryptonote_core.cpp @@ -1178,10 +1178,10 @@ namespace cryptonote return m_mempool.check_for_key_images(key_im, spent); } //----------------------------------------------------------------------------------------------- - std::pair core::get_coinbase_tx_sum(const uint64_t start_offset, const size_t count) + std::pair core::get_coinbase_tx_sum(const uint64_t start_offset, const size_t count) { - uint64_t emission_amount = 0; - uint64_t total_fee_amount = 0; + boost::multiprecision::uint128_t emission_amount = 0; + boost::multiprecision::uint128_t total_fee_amount = 0; if (count) { const uint64_t end = start_offset + count - 1; @@ -1203,7 +1203,7 @@ namespace cryptonote }); } - return std::pair(emission_amount, total_fee_amount); + return std::pair(emission_amount, total_fee_amount); } //----------------------------------------------------------------------------------------------- bool core::check_tx_inputs_keyimages_diff(const transaction& tx) const diff --git a/src/cryptonote_core/cryptonote_core.h b/src/cryptonote_core/cryptonote_core.h index f69ac3509..01df86fd5 100644 --- a/src/cryptonote_core/cryptonote_core.h +++ b/src/cryptonote_core/cryptonote_core.h @@ -743,7 +743,7 @@ namespace cryptonote * * @return the number of blocks to sync in one go */ - std::pair get_coinbase_tx_sum(const uint64_t start_offset, const size_t count); + std::pair get_coinbase_tx_sum(const uint64_t start_offset, const size_t count); /** * @brief get the network type we're on -- cgit v1.2.3