CLN - Add brakets around ipv6

This commit is contained in:
nymkappa 2022-08-30 20:31:04 +02:00
parent c289f821e4
commit c150129d74
No known key found for this signature in database
GPG key ID: E155910B16E8BD04

View file

@ -13,9 +13,13 @@ export function convertNode(clNode: any): ILightningApi.Node {
features: [], // TODO parse and return clNode.feature
pub_key: clNode.nodeid,
addresses: clNode.addresses?.map((addr) => {
let address = addr.address;
if (addr.type === 'ipv6') {
address = `[${address}]`;
}
return {
network: addr.type,
addr: `${addr.address}:${addr.port}`
addr: `${address}:${addr.port}`
};
}) ?? [],
last_update: clNode?.last_timestamp ?? 0,