From 2ac4ce122ffcd5b2b198e4443fd4905dcc78dc20 Mon Sep 17 00:00:00 2001 From: whyrusleeping Date: Wed, 16 Oct 2019 16:45:48 +0900 Subject: [PATCH] check return code of create storage miner call --- cmd/lotus-storage-miner/init.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/lotus-storage-miner/init.go b/cmd/lotus-storage-miner/init.go index 7773d7ac0..2ece8004d 100644 --- a/cmd/lotus-storage-miner/init.go +++ b/cmd/lotus-storage-miner/init.go @@ -309,6 +309,10 @@ func createStorageMiner(ctx context.Context, api api.FullNode, peerid peer.ID, c return address.Undef, err } + if mw.Receipt.ExitCode != 0 { + return address.Undef, xerrors.Errorf("create storage miner failed: exit code %d", mw.Receipt.ExitCode) + } + addr, err = address.NewFromBytes(mw.Receipt.Return) if err != nil { return address.Undef, err