diff --git a/internal/peer/common/common.go b/internal/peer/common/common.go index ea8ea29a59d..6c7035a4a7f 100644 --- a/internal/peer/common/common.go +++ b/internal/peer/common/common.go @@ -166,7 +166,11 @@ func InitCrypto(mspMgrConfigDir, localMSPID, localMSPType string) error { return errors.WithMessage(err, "could not decode peer BCCSP configuration") } - err = mspmgmt.LoadLocalMspWithType(mspMgrConfigDir, bccspConfig, localMSPID, localMSPType) + conf, err := msp.GetLocalMspConfigWithType(mspMgrConfigDir, bccspConfig, localMSPID, localMSPType) + if err != nil { + return err + } + err = mspmgmt.GetLocalMSP(factory.GetDefault()).Setup(conf) if err != nil { return errors.WithMessagef(err, "error when setting up MSP of type %s from directory %s", localMSPType, mspMgrConfigDir) } diff --git a/msp/mgmt/mgmt.go b/msp/mgmt/mgmt.go index 60953e6c359..85391d677e6 100644 --- a/msp/mgmt/mgmt.go +++ b/msp/mgmt/mgmt.go @@ -19,20 +19,6 @@ import ( "github.com/spf13/viper" ) -// LoadLocalMspWithType loads the local MSP with the specified type from the specified directory -func LoadLocalMspWithType(dir string, bccspConfig *factory.FactoryOpts, mspID, mspType string) error { - if mspID == "" { - return errors.New("the local MSP must have an ID") - } - - conf, err := msp.GetLocalMspConfigWithType(dir, bccspConfig, mspID, mspType) - if err != nil { - return err - } - - return GetLocalMSP(factory.GetDefault()).Setup(conf) -} - // LoadLocalMsp loads the local MSP from the specified directory func LoadLocalMsp(dir string, bccspConfig *factory.FactoryOpts, mspID string) error { if mspID == "" {