mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-22 16:44:20 +01:00
common/gossmap: fix gossmap_node_get_announce() on unannounced nodes.
We would return junk before. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -823,8 +823,14 @@ u8 *gossmap_node_get_announce(const tal_t *ctx,
|
||||
const struct gossmap *map,
|
||||
const struct gossmap_node *n)
|
||||
{
|
||||
u16 len = map_be16(map, n->nann_off);
|
||||
u8 *msg = tal_arr(ctx, u8, len);
|
||||
u16 len;
|
||||
u8 *msg;
|
||||
|
||||
if (n->nann_off == 0)
|
||||
return NULL;
|
||||
|
||||
len = map_be16(map, n->nann_off);
|
||||
msg = tal_arr(ctx, u8, len);
|
||||
|
||||
map_copy(map, n->nann_off, msg, len);
|
||||
return msg;
|
||||
|
||||
Reference in New Issue
Block a user