diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-05-30 15:03:36 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-05-30 16:10:53 +0100 |
commit | 15e029ac6db3c81585049f7f6452b7e494642dd6 (patch) | |
tree | f2c772f2bf8e348fb4466483c7c6fd1ef2a3497d /src | |
parent | Merge pull request #3846 (diff) | |
download | monero-15e029ac6db3c81585049f7f6452b7e494642dd6.tar.xz |
rpc: fix get_output_distribution cache for the cumulative case
The distribution was not converted to cumulative after a cache hit
Diffstat (limited to 'src')
-rw-r--r-- | src/rpc/core_rpc_server.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp index e28914d96..7d769e0dc 100644 --- a/src/rpc/core_rpc_server.cpp +++ b/src/rpc/core_rpc_server.cpp @@ -2112,6 +2112,13 @@ namespace cryptonote { res.distributions.push_back({amount, slot.start_height, slot.distribution, slot.base}); found = true; + if (req.cumulative) + { + auto &distribution = res.distributions.back().distribution; + distribution[0] += slot.base; + for (size_t n = 1; n < distribution.size(); ++n) + distribution[n] += distribution[n-1]; + } break; } } |