From 8481fde84216648f9a20e7f2dc2c6b2447032057 Mon Sep 17 00:00:00 2001 From: oren-lava <111131399+oren-lava@users.noreply.github.com> Date: Sun, 1 Sep 2024 15:02:24 +0300 Subject: [PATCH] fix: total gas query: check sequence (#1659) * check sequence * revert time change --- utils/cli/multisend.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/utils/cli/multisend.go b/utils/cli/multisend.go index 7adf692594..60261a4e59 100644 --- a/utils/cli/multisend.go +++ b/utils/cli/multisend.go @@ -418,6 +418,19 @@ func NewQueryTotalGasCmd() *cobra.Command { totalgas := int64(0) numRelays := int64(0) sequence, _ := getSequence(account) + if sequence == 0 { + block := clientCtx.Height + if block == 0 { + res, err := clientCtx.Client.Status(context.Background()) + if err != nil { + fmt.Println("failed to get latest block height and account sequence") + return nil + } + block = res.SyncInfo.LatestBlockHeight + } + fmt.Printf("could not get account sequence for block %d\n", block) + return nil + } layout := time.RFC3339 for now.Sub(txtime) < 12*time.Hour { sequence--