aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2016-12-21 20:43:31 +0200
committerRiccardo Spagni <ric@spagni.net>2016-12-21 20:43:31 +0200
commit6f539159e8d3b8d1613c26e0c07308482e84c8de (patch)
treea2f37191e5651d02a09f5cb0a4ab361d200038fd
parentMerge pull request #1483 (diff)
parentcore: fix recalculation of emission/fees (diff)
downloadmonero-6f539159e8d3b8d1613c26e0c07308482e84c8de.tar.xz
Merge pull request #1484
12abe86a core: fix recalculation of emission/fees (moneromooo-monero)
-rw-r--r--src/cryptonote_core/cryptonote_core.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp
index 3ddda9efb..4010d3d44 100644
--- a/src/cryptonote_core/cryptonote_core.cpp
+++ b/src/cryptonote_core/cryptonote_core.cpp
@@ -619,17 +619,16 @@ namespace cryptonote
std::pair<uint64_t, uint64_t> core::get_coinbase_tx_sum(const uint64_t start_offset, const size_t count)
{
std::list<block> blocks;
- std::list<transaction> txs;
- std::list<crypto::hash> missed_txs;
- uint64_t coinbase_amount = 0;
uint64_t emission_amount = 0;
uint64_t total_fee_amount = 0;
- uint64_t tx_fee_amount = 0;
this->get_blocks(start_offset, count, blocks);
BOOST_FOREACH(auto& b, blocks)
{
- coinbase_amount = get_outs_money_amount(b.miner_tx);
+ std::list<transaction> txs;
+ std::list<crypto::hash> missed_txs;
+ uint64_t coinbase_amount = get_outs_money_amount(b.miner_tx);
this->get_transactions(b.tx_hashes, txs, missed_txs);
+ uint64_t tx_fee_amount = 0;
BOOST_FOREACH(const auto& tx, txs)
{
tx_fee_amount += get_tx_fee(tx);
@@ -637,8 +636,6 @@ namespace cryptonote
emission_amount += coinbase_amount - tx_fee_amount;
total_fee_amount += tx_fee_amount;
- coinbase_amount = 0;
- tx_fee_amount = 0;
}
return std::pair<uint64_t, uint64_t>(emission_amount, total_fee_amount);