1
0
mirror of https://github.com/romanz/electrs.git synced 2024-11-19 01:43:29 +01:00

Merge pull request #761 from romanz/fix-rate

Fix mempool fee rate formatting
This commit is contained in:
Roman Zeyde 2022-08-14 22:52:33 +03:00 committed by GitHub
commit 64e085b3ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -133,9 +133,9 @@ impl Mempool {
self.add_entry(*txid, tx, entry);
}
self.fees = FeeHistogram::new(self.entries.values().map(|e| (e.fee, e.vsize)));
for i in 1..FeeHistogram::BINS {
for i in 0..FeeHistogram::BINS {
let bin_index = FeeHistogram::BINS - i - 1; // from 63 to 0
let limit = 1u64 << i;
let limit = 1u128 << i;
let label = format!("[{:20.0}, {:20.0})", limit / 2, limit);
self.vsize.set(&label, self.fees.vsize[bin_index] as f64);
self.count.set(&label, self.fees.count[bin_index] as f64);