mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 15:44:21 +01:00
routing: Actually return the port when parsing node_announcements
We parsed it, but did not pass it back out.
This commit is contained in:
@@ -576,6 +576,7 @@ bool read_ip(const tal_t *ctx, const u8 *addresses, char **hostname,
|
|||||||
inet_ntop(AF_INET, p, tempaddr, sizeof(tempaddr));
|
inet_ntop(AF_INET, p, tempaddr, sizeof(tempaddr));
|
||||||
memcpy(&portnum, p + 4, sizeof(portnum));
|
memcpy(&portnum, p + 4, sizeof(portnum));
|
||||||
*hostname = tal_strdup(ctx, tempaddr);
|
*hostname = tal_strdup(ctx, tempaddr);
|
||||||
|
*port = be16_to_cpu(portnum);
|
||||||
return true;
|
return true;
|
||||||
case 2:
|
case 2:
|
||||||
if (len < 18)
|
if (len < 18)
|
||||||
@@ -583,6 +584,7 @@ bool read_ip(const tal_t *ctx, const u8 *addresses, char **hostname,
|
|||||||
inet_ntop(AF_INET6, p, tempaddr, sizeof(tempaddr));
|
inet_ntop(AF_INET6, p, tempaddr, sizeof(tempaddr));
|
||||||
memcpy(&portnum, p + 16, sizeof(portnum));
|
memcpy(&portnum, p + 16, sizeof(portnum));
|
||||||
*hostname = tal_strdup(ctx, tempaddr);
|
*hostname = tal_strdup(ctx, tempaddr);
|
||||||
|
*port = be16_to_cpu(portnum);
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
/* BOLT #7:
|
/* BOLT #7:
|
||||||
|
|||||||
Reference in New Issue
Block a user