From bc0337e11764c6a85aec4be067e440749ace9a65 Mon Sep 17 00:00:00 2001 From: Patrick O'Grady Date: Tue, 1 Dec 2020 15:28:34 -0600 Subject: [PATCH] add simple fix for negative number --- storage/modules/balance_storage.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/storage/modules/balance_storage.go b/storage/modules/balance_storage.go index 00778913..49b9a349 100644 --- a/storage/modules/balance_storage.go +++ b/storage/modules/balance_storage.go @@ -1317,7 +1317,9 @@ func (b *BalanceStorage) removeHistoricalBalances( } } - if orphan { + // We don't update the pruned value when index is less + // than 0 because big.Int conversion doesn't support signed values. + if orphan || index < 0 { return nil }