From bcfad6b2bbba7b345d671e18e8c8016f89d18a9a Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Wed, 28 Apr 2021 17:51:25 -0700 Subject: [PATCH] fix(lotus-shed): sanity check start height for dup check --- cmd/lotus-shed/balances.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/lotus-shed/balances.go b/cmd/lotus-shed/balances.go index 669e8590d..87530c666 100644 --- a/cmd/lotus-shed/balances.go +++ b/cmd/lotus-shed/balances.go @@ -205,6 +205,9 @@ every day of chain processed. } target := abi.ChainEpoch(cctx.Int("start")) + if target < 0 || target > head.Height() { + return fmt.Errorf("start height must be greater than 0 and less than the end height") + } totalEpochs := head.Height() - target for target <= head.Height() {