From c244a0bbdc3ccd8c3ad0346257e3ed60b887d763 Mon Sep 17 00:00:00 2001 From: kaola526 Date: Fri, 10 Jun 2022 00:36:46 +0800 Subject: [PATCH] fix bug #8825 --- cli/multisig.go | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/cli/multisig.go b/cli/multisig.go index d9255f6e4..7d58bb2e2 100644 --- a/cli/multisig.go +++ b/cli/multisig.go @@ -881,6 +881,40 @@ var msigAddProposeCmd = &cli.Command{ from = defaddr } + store := adt.WrapStore(ctx, cbor.NewCborStore(blockstore.NewAPIBlockstore(api))) + + head, err := api.ChainHead(ctx) + if err != nil { + return err + } + + act, err := api.StateGetActor(ctx, msig, head.Key()) + if err != nil { + return err + } + + mstate, err := multisig.Load(store, act) + if err != nil { + return err + } + + signers, err := mstate.Signers() + if err != nil { + return err + } + + for _, s := range signers { + signerActor, err := api.StateAccountKey(ctx, s, types.EmptyTSK) + if err != nil { + return err + } + + if signerActor == addr { + return fmt.Errorf("The add a signer address(%s) is included in the signers", addr.String()) + } + + } + proto, err := api.MsigAddPropose(ctx, msig, from, addr, cctx.Bool("increase-threshold")) if err != nil { return err