From ee5dcbc1d825081558f2f89841fe7ef7a5615da4 Mon Sep 17 00:00:00 2001 From: jennijuju Date: Tue, 20 Oct 2020 18:26:17 -0400 Subject: [PATCH] Add wait message --- cmd/lotus-shed/sectors.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/cmd/lotus-shed/sectors.go b/cmd/lotus-shed/sectors.go index 45af36118..11e678642 100644 --- a/cmd/lotus-shed/sectors.go +++ b/cmd/lotus-shed/sectors.go @@ -2,12 +2,13 @@ package main import ( "fmt" + "strconv" + "github.com/filecoin-project/go-bitfield" "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/big" "github.com/filecoin-project/lotus/chain/actors" "golang.org/x/xerrors" - "strconv" "github.com/filecoin-project/lotus/chain/types" lcli "github.com/filecoin-project/lotus/cli" @@ -114,7 +115,16 @@ var terminateSectorCmd = &cli.Command{ return xerrors.Errorf("mpool push message: %w", err) } - fmt.Println("Message CID:", smsg.Cid()) + fmt.Println("sent termination message:", smsg.Cid()) + + wait, err := nodeApi.StateWaitMsg(ctx, smsg.Cid(), uint64(cctx.Int("confidence"))) + if err != nil { + return err + } + + if wait.Receipt.ExitCode != 0 { + return fmt.Errorf("terminate sectors message returned exit %d", wait.Receipt.ExitCode) + } return nil },