mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-22 08:34:20 +01:00
gossipd: be more verbose and less assert()ive on bad node_announcement.
We hit the timestamp assert on #2750; it shouldn't happen, but crashing doesn't leave much information. Reported-by: @m-schmook Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -485,8 +485,18 @@ static bool get_node_announcement(const tal_t *ctx,
|
|||||||
n->bcast.index, tal_hex(tmpctx, msg));
|
n->bcast.index, tal_hex(tmpctx, msg));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
assert(node_id_eq(&id, &n->id));
|
|
||||||
assert(timestamp == n->bcast.timestamp);
|
if (!node_id_eq(&id, &n->id) || timestamp != n->bcast.timestamp) {
|
||||||
|
status_broken("Wrong node_announcement @%u:"
|
||||||
|
" expected %s timestamp %u "
|
||||||
|
" got %s timestamp %u",
|
||||||
|
n->bcast.index,
|
||||||
|
type_to_string(tmpctx, struct node_id, &n->id),
|
||||||
|
timestamp,
|
||||||
|
type_to_string(tmpctx, struct node_id, &id),
|
||||||
|
n->bcast.timestamp);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
*wireaddrs = read_addresses(ctx, addresses);
|
*wireaddrs = read_addresses(ctx, addresses);
|
||||||
tal_free(addresses);
|
tal_free(addresses);
|
||||||
|
|||||||
Reference in New Issue
Block a user