diff --git a/node/remote/node.go b/node/remote/node.go index 9594600e..2235d097 100644 --- a/node/remote/node.go +++ b/node/remote/node.go @@ -8,6 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" + "google.golang.org/grpc" constypes "github.com/tendermint/tendermint/consensus/types" tmjson "github.com/tendermint/tendermint/libs/json" @@ -34,6 +35,7 @@ type Node struct { codec codec.Marshaler client *httpclient.HTTP txServiceClient tx.ServiceClient + grpcConnection *grpc.ClientConn } // NewNode allows to build a new Node instance @@ -71,6 +73,7 @@ func NewNode(cfg *Details, codec codec.Marshaler) (*Node, error) { client: rpcClient, txServiceClient: tx.NewServiceClient(grpcConnection), + grpcConnection: grpcConnection, }, nil } @@ -201,4 +204,9 @@ func (cp *Node) Stop() { if err != nil { panic(fmt.Errorf("error while stopping proxy: %s", err)) } + + err = cp.grpcConnection.Close() + if err != nil { + panic(fmt.Errorf("error while closing gRPC connection: %s", err)) + } }