mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-12-24 14:17:46 +00:00
Merge pull request #5900
6bbc646
Fix bug in mempool get_transaction_stats histogram calculation (tomsmeding)
This commit is contained in:
commit
d9cb50870d
1 changed files with 10 additions and 3 deletions
|
@ -746,8 +746,15 @@ namespace cryptonote
|
||||||
/* If enough txs, spread the first 98% of results across
|
/* If enough txs, spread the first 98% of results across
|
||||||
* the first 9 bins, drop final 2% in last bin.
|
* the first 9 bins, drop final 2% in last bin.
|
||||||
*/
|
*/
|
||||||
it=agebytes.end();
|
it = agebytes.end();
|
||||||
for (size_t n=0; n <= end; n++, it--);
|
size_t cumulative_num = 0;
|
||||||
|
/* Since agebytes is not empty and end is nonzero, the
|
||||||
|
* below loop can always run at least once.
|
||||||
|
*/
|
||||||
|
do {
|
||||||
|
--it;
|
||||||
|
cumulative_num += it->second.txs;
|
||||||
|
} while (it != agebytes.begin() && cumulative_num < end);
|
||||||
stats.histo_98pc = it->first;
|
stats.histo_98pc = it->first;
|
||||||
factor = 9;
|
factor = 9;
|
||||||
delta = it->first;
|
delta = it->first;
|
||||||
|
|
Loading…
Reference in a new issue