fix remaining blocks info msg

This commit is contained in:
Gustavo Chain 2020-02-14 23:00:58 +01:00
parent fd4272886b
commit 6c91f757aa
No known key found for this signature in database
GPG Key ID: DA7C1746DC118A46
2 changed files with 9 additions and 2 deletions

View File

@ -75,7 +75,7 @@ func (b ProjectedBlock) Print(n int, x, _y int) []byte {
var full int
if n < 3 {
full = int(
float64(b.BlockWeight) / 4000000 * 10,
float64(b.BlockWeight) / 4_000_000 * 10,
)
}

View File

@ -252,9 +252,16 @@ func (ui *UI) info(g *gocui.Gui, x, y int) error {
mSize += b.BlockSize
}
// Compute the total number of blocks on the mempool
// We use the total BlockWeight / 4mm
var w float64
for _, b := range ui.state.projected {
w += float64(b.BlockWeight)
}
fmt.Fprintf(v, "%s %s, %s %s",
red("Unconfirmed Txs: "), white("%d", info.Size),
blue("Mempool size"), white("%s (%d block/s)", fmtSize(mSize), len(ui.state.projected)),
blue("Mempool size"), white("%s (%d block/s)", fmtSize(mSize), ceil(w/4_000_000)),
)
return nil
}