From 6cd9f4838796e0c93b1f14bdfb8d9c8dc702e1e4 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Tue, 2 May 2017 19:51:33 -0700 Subject: [PATCH] rpc: list the active chains in GetInfoResponse MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit modifies the server’s implementation of the GetInfo command to list the chains that lnd is currently active within. --- rpcserver.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rpcserver.go b/rpcserver.go index 482f14dc..4b274dcc 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -675,6 +675,10 @@ func (r *rpcServer) GetInfo(ctx context.Context, return nil, err } + activeChains := make([]string, registeredChains.NumActiveChains()) + for i, chain := range registeredChains.ActiveChains() { + activeChains[i] = chain.String() + } // TODO(roasbeef): add synced height n stuff return &lnrpc.GetInfoResponse{ IdentityPubkey: hex.EncodeToString(idPub), @@ -685,6 +689,7 @@ func (r *rpcServer) GetInfo(ctx context.Context, BlockHash: bestHash.String(), SyncedToChain: isSynced, Testnet: activeNetParams.Params == &chaincfg.TestNet3Params, + Chains: activeChains, }, nil }