aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-05-30 15:03:36 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-05-30 15:03:36 +0100
commitb665bab1d6bf6aa44c13690b2109a773996433ae (patch)
tree494fa975452a56f4ae1fdbbe45c790b657a59ff6 /src/rpc
parentMerge pull request #3251 (diff)
downloadmonero-b665bab1d6bf6aa44c13690b2109a773996433ae.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/rpc')
-rw-r--r--src/rpc/core_rpc_server.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp
index b5ef2557a..edda47557 100644
--- a/src/rpc/core_rpc_server.cpp
+++ b/src/rpc/core_rpc_server.cpp
@@ -2097,6 +2097,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;
}
}