rpc: list the active chains in GetInfoResponse

This commit modifies the server’s implementation of the GetInfo command
to list the chains that lnd is currently active within.
This commit is contained in:
Olaoluwa Osuntokun 2017-05-02 19:51:33 -07:00
parent 71514ceb14
commit 6cd9f48387
No known key found for this signature in database
GPG Key ID: 9CC5B105D03521A2

@ -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
}