rpc: the cache is still for non cumulative on that branch

This commit is contained in:
moneromooo-monero 2018-06-01 09:02:45 +01:00 committed by wowario
parent 36deb5d509
commit 3bd9d61c33
No known key found for this signature in database
GPG key ID: 24DCBE762DE9C111

View file

@ -2100,6 +2100,13 @@ namespace cryptonote
if (d.cached && amount == 0 && d.cached_from == req.from_height && d.cached_to == req.to_height) 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}); 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; continue;
} }