mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-12-09 20:33:45 +01:00
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:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user