From 38558a3238df9d69a2024f5d72427e6d1d68bfac Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 27 Jul 2022 18:00:19 +0300 Subject: [PATCH] [#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 --- cmd/neofs-adm/internal/modules/morph/local_client.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/neofs-adm/internal/modules/morph/local_client.go b/cmd/neofs-adm/internal/modules/morph/local_client.go index 2b3c2559..bb4132bf 100644 --- a/cmd/neofs-adm/internal/modules/morph/local_client.go +++ b/cmd/neofs-adm/internal/modules/morph/local_client.go @@ -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),