[#1633] neofs-adm: Start chain only on happy path

If the error is returned, it will not be closed properly.

Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
This commit is contained in:
Evgenii Stratonikov 2022-07-27 18:00:19 +03:00 committed by fyrchik
parent 642d7328ab
commit 38558a3238

View file

@ -54,7 +54,6 @@ func newLocalClient(v *viper.Viper, wallets []*wallet.Wallet) (*localClient, err
if err != nil {
return nil, err
}
defer func() { go bc.Run() }()
m := smartcontract.GetDefaultHonestNodeCount(cfg.ProtocolConfiguration.ValidatorsCount)
accounts := make([]*wallet.Account, len(wallets))
@ -81,6 +80,8 @@ func newLocalClient(v *viper.Viper, wallets []*wallet.Wallet) (*localClient, err
return bytes.Compare(pi, pj) == -1
})
go bc.Run()
return &localClient{
bc: bc,
dumpPath: v.GetString(localDumpFlag),