From 2eb974ca2a9b8d02a7140f6e2ec32263e6073298 Mon Sep 17 00:00:00 2001 From: Gustavo Chain Date: Fri, 14 Feb 2020 11:54:30 +0100 Subject: [PATCH] fix panic on projecteblocks --- ui/ui.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ui/ui.go b/ui/ui.go index 639d42d..dceaa0a 100644 --- a/ui/ui.go +++ b/ui/ui.go @@ -258,6 +258,10 @@ func (ui *UI) printProjectedBlock(n int) []byte { offset := 9 - int( float64(block.BlockWeight)/4000000.0*10, ) + if offset < 0 { + offset = 0 + } + for i := offset; i < len(lines); i++ { lines[i] = bg("%s", lines[i]) }