aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/core_rpc_server.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-06-01 09:02:45 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-06-01 09:05:47 +0100
commitab87e7fdae31d5745a08d6a4223364e68dd5dced (patch)
tree72331b6ec549198d41681ae9e1506b4e7544c4ac /src/rpc/core_rpc_server.cpp
parent8a7b3ff13858c5d879530c99de5c723c88429342 (diff)
downloadmonzero-core-ab87e7fdae31d5745a08d6a4223364e68dd5dced.tar.gz
monzero-core-ab87e7fdae31d5745a08d6a4223364e68dd5dced.tar.xz
monzero-core-ab87e7fdae31d5745a08d6a4223364e68dd5dced.zip
rpc: the cache is still for non cumulative on that branch
Diffstat (limited to 'src/rpc/core_rpc_server.cpp')
-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 aa105567c..adfadfef1 100644
--- a/src/rpc/core_rpc_server.cpp
+++ b/src/rpc/core_rpc_server.cpp
@@ -2087,6 +2087,13 @@ namespace cryptonote
if (d.cached && amount == 0 && d.cached_from == req.from_height && d.cached_to == req.to_height)
{
res.distributions.push_back({amount, d.cached_start_height, d.cached_distribution, d.cached_base});
+ if (req.cumulative)
+ {
+ auto &distribution = res.distributions.back().distribution;
+ distribution[0] += d.cached_base;
+ for (size_t n = 1; n < distribution.size(); ++n)
+ distribution[n] += distribution[n-1];
+ }
continue;
}