CLN - Add brakets around ipv6
This commit is contained in:
parent
c289f821e4
commit
c150129d74
@ -13,9 +13,13 @@ export function convertNode(clNode: any): ILightningApi.Node {
|
|||||||
features: [], // TODO parse and return clNode.feature
|
features: [], // TODO parse and return clNode.feature
|
||||||
pub_key: clNode.nodeid,
|
pub_key: clNode.nodeid,
|
||||||
addresses: clNode.addresses?.map((addr) => {
|
addresses: clNode.addresses?.map((addr) => {
|
||||||
|
let address = addr.address;
|
||||||
|
if (addr.type === 'ipv6') {
|
||||||
|
address = `[${address}]`;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
network: addr.type,
|
network: addr.type,
|
||||||
addr: `${addr.address}:${addr.port}`
|
addr: `${address}:${addr.port}`
|
||||||
};
|
};
|
||||||
}) ?? [],
|
}) ?? [],
|
||||||
last_update: clNode?.last_timestamp ?? 0,
|
last_update: clNode?.last_timestamp ?? 0,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user