lnrpc: expose network name in GetInfo

Previously only a testnet boolean was available which
made it impossible to distinguish between regtest and
mainnet.
This commit is contained in:
Joost Jager committed 2019-01-08 00:17:14 +01:00
1 parent f63ab4beda
commit 649408003d
5 files changed
+661 -567

No files matched your search

+7 -2
View File
@@ -1748,9 +1748,14 @@ func (r *rpcServer) GetInfo(ctx context.Context,
"with current best block in the main chain: %v", err)
}
activeChains := make([]string, registeredChains.NumActiveChains())
network := normalizeNetwork(activeNetParams.Name)
activeChains := make([]*lnrpc.Chain, registeredChains.NumActiveChains())
for i, chain := range registeredChains.ActiveChains() {
activeChains[i] = chain.String()
activeChains[i] = &lnrpc.Chain{
Chain: chain.String(),
Network: network,
}
}
// Check if external IP addresses were provided to lnd and use them