diff --git a/client/chain/chain.go b/client/chain/chain.go index d645a8ad..3151b511 100644 --- a/client/chain/chain.go +++ b/client/chain/chain.go @@ -272,7 +272,11 @@ func NewChainClient( } // create file if not exist - os.OpenFile(defaultChainCookieName, os.O_RDONLY|os.O_CREATE, 0666) + cookie_file, err := os.OpenFile(defaultChainCookieName, os.O_RDONLY|os.O_CREATE, 0666) + if err != nil { + cc.logger.Errorln(err) + } + defer cookie_file.Close() // attempt to load from disk data, err := os.ReadFile(defaultChainCookieName) @@ -480,6 +484,10 @@ func (c *chainClient) Close() { if c.conn != nil { c.conn.Close() } + + if c.cometbftClient != nil { + c.cometbftClient.Stop() + } } func (c *chainClient) GetBankBalances(ctx context.Context, address string) (*banktypes.QueryAllBalancesResponse, error) {