aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-09-12 19:19:22 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-09-12 19:20:16 +0000
commitb2bb9312a75781e714acf3c406634b3d4cded418 (patch)
treec4559eda226e88a86ccf46cf568f6164cb9f5617
parentdb_lmdb: do not use base for cumulative distribution (diff)
downloadmonero-b2bb9312a75781e714acf3c406634b3d4cded418.tar.xz
blockchain: simplify output distribution code
-rw-r--r--src/cryptonote_core/blockchain.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp
index b20fe9869..578c951be 100644
--- a/src/cryptonote_core/blockchain.cpp
+++ b/src/cryptonote_core/blockchain.cpp
@@ -2054,15 +2054,10 @@ bool Blockchain::get_output_distribution(uint64_t amount, uint64_t from_height,
{
std::vector<uint64_t> heights;
heights.reserve(to_height + 1 - start_height);
- uint64_t real_start_height = start_height > 0 ? start_height-1 : start_height;
- for (uint64_t h = real_start_height; h <= to_height; ++h)
+ for (uint64_t h = start_height; h <= to_height; ++h)
heights.push_back(h);
distribution = m_db->get_block_cumulative_rct_outputs(heights);
- if (start_height > 0)
- {
- base = distribution[0];
- distribution.erase(distribution.begin());
- }
+ base = 0;
return true;
}
else