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:
1 file changed
+5
@@ -675,6 +675,10 @@ func (r *rpcServer) GetInfo(ctx context.Context,
|
|||||||
return nil, err
|
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
|
// TODO(roasbeef): add synced height n stuff
|
||||||
return &lnrpc.GetInfoResponse{
|
return &lnrpc.GetInfoResponse{
|
||||||
IdentityPubkey: hex.EncodeToString(idPub),
|
IdentityPubkey: hex.EncodeToString(idPub),
|
||||||
@@ -685,6 +689,7 @@ func (r *rpcServer) GetInfo(ctx context.Context,
|
|||||||
BlockHash: bestHash.String(),
|
BlockHash: bestHash.String(),
|
||||||
SyncedToChain: isSynced,
|
SyncedToChain: isSynced,
|
||||||
Testnet: activeNetParams.Params == &chaincfg.TestNet3Params,
|
Testnet: activeNetParams.Params == &chaincfg.TestNet3Params,
|
||||||
|
Chains: activeChains,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user