mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-22 14:22:37 +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:
parent
71514ceb14
commit
6cd9f48387
1 changed files with 5 additions and 0 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue