|
|
@ -6,6 +6,13 @@ void fromwire_gossip_getnodes_entry(const tal_t *ctx, const u8 **pptr, size_t *m |
|
|
|
{ |
|
|
|
u8 numaddresses, i; |
|
|
|
fromwire_pubkey(pptr, max, &entry->nodeid); |
|
|
|
entry->last_timestamp = fromwire_u64(pptr, max); |
|
|
|
|
|
|
|
if (entry->last_timestamp < 0) { |
|
|
|
entry->addresses = NULL; |
|
|
|
entry->alias = NULL; |
|
|
|
return; |
|
|
|
} |
|
|
|
numaddresses = fromwire_u8(pptr, max); |
|
|
|
|
|
|
|
entry->addresses = tal_arr(ctx, struct wireaddr, numaddresses); |
|
|
@ -16,16 +23,26 @@ void fromwire_gossip_getnodes_entry(const tal_t *ctx, const u8 **pptr, size_t *m |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
entry->alias = tal_arr(ctx, u8, fromwire_u8(pptr, max)); |
|
|
|
fromwire(pptr, max, entry->alias, tal_len(entry->alias)); |
|
|
|
fromwire(pptr, max, entry->color, sizeof(entry->color)); |
|
|
|
} |
|
|
|
void towire_gossip_getnodes_entry(u8 **pptr, const struct gossip_getnodes_entry *entry) |
|
|
|
{ |
|
|
|
u8 i, numaddresses = tal_count(entry->addresses); |
|
|
|
towire_pubkey(pptr, &entry->nodeid); |
|
|
|
towire_u8(pptr, numaddresses); |
|
|
|
towire_u64(pptr, entry->last_timestamp); |
|
|
|
|
|
|
|
if (entry->last_timestamp < 0) |
|
|
|
return; |
|
|
|
|
|
|
|
towire_u8(pptr, numaddresses); |
|
|
|
for (i=0; i<numaddresses; i++) { |
|
|
|
towire_wireaddr(pptr, &entry->addresses[i]); |
|
|
|
} |
|
|
|
towire_u8(pptr, tal_len(entry->alias)); |
|
|
|
towire(pptr, entry->alias, tal_len(entry->alias)); |
|
|
|
towire(pptr, entry->color, sizeof(entry->color)); |
|
|
|
} |
|
|
|
|
|
|
|
void fromwire_route_hop(const u8 **pptr, size_t *max, struct route_hop *entry) |
|
|
|