mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 22:45:27 +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:
parent
bb9ad57a03
commit
52c465fef0
1 changed files with 8 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue