diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-11-06 11:02:27 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-11-16 10:02:59 +0000 |
commit | 872c7eb26abec64478e8c2f68e13f12b93b7ed46 (patch) | |
tree | 3e00e53027df1222604db84097d15ffa8cdb46b6 /src | |
parent | Merge pull request #4820 (diff) | |
download | monero-872c7eb26abec64478e8c2f68e13f12b93b7ed46.tar.xz |
Revert "blockchain: simplify output distribution code"
This reverts commit b2bb9312a75781e714acf3c406634b3d4cded418.
Diffstat (limited to 'src')
-rw-r--r-- | src/cryptonote_core/blockchain.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index f3105114e..030798ad7 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -1831,10 +1831,15 @@ bool Blockchain::get_output_distribution(uint64_t amount, uint64_t from_height, { std::vector<uint64_t> heights; heights.reserve(to_height + 1 - start_height); - for (uint64_t h = start_height; h <= to_height; ++h) + uint64_t real_start_height = start_height > 0 ? start_height-1 : start_height; + for (uint64_t h = real_start_height; h <= to_height; ++h) heights.push_back(h); distribution = m_db->get_block_cumulative_rct_outputs(heights); - base = 0; + if (start_height > 0) + { + base = distribution[0]; + distribution.erase(distribution.begin()); + } return true; } else |