Merge pull request #2468 from mempool/nymkappa/bugfix/ipv6-cln

CLN - Add brakets around ipv6
This commit is contained in:
wiz 2022-08-30 21:09:18 +02:00 committed by GitHub
commit 91355c0936
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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,