Merge pull request #3883

15e029ac rpc: fix get_output_distribution cache for the cumulative case (moneromooo-monero)
This commit is contained in:
Riccardo Spagni 2018-05-31 21:24:52 +02:00
commit 0dac3afc22
No known key found for this signature in database
GPG key ID: 55432DF31CCD4FCD

View file

@ -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;
}
}