rpc: fix get_output_distribution cache for the cumulative case
The distribution was not converted to cumulative after a cache hit
This commit is contained in:
parent
24cd25d87e
commit
fd83770790
|
@ -2102,10 +2102,16 @@ namespace cryptonote
|
||||||
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)
|
if (req.cumulative)
|
||||||
{
|
{
|
||||||
auto &distribution = res.distributions.back().distribution;
|
res.distributions.push_back({amount, slot.start_height, slot.distribution, slot.base});
|
||||||
distribution[0] += d.cached_base;
|
found = true;
|
||||||
for (size_t n = 1; n < distribution.size(); ++n)
|
if (req.cumulative)
|
||||||
distribution[n] += distribution[n-1];
|
{
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue