mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-26 20:30:59 +01:00
gossipd: don't assert on redundant flag write, just log message.
This happens to Vincenzo, and I think it's due to previous gossip_store issues. Fixes: https://github.com/ElementsProject/lightning/issues/7051 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
e7f1f29dbd
commit
1350194698
1 changed files with 6 additions and 1 deletions
|
@ -509,9 +509,14 @@ u64 gossip_store_set_flag(struct gossip_store *gs,
|
||||||
if (!check_msg_type(gs, offset, flag, type, &hdr))
|
if (!check_msg_type(gs, offset, flag, type, &hdr))
|
||||||
return offset;
|
return offset;
|
||||||
|
|
||||||
assert((be16_to_cpu(hdr.flags) & flag) == 0);
|
if (be16_to_cpu(hdr.flags) & flag) {
|
||||||
|
status_broken("gossip_store flag-%u @%"PRIu64" for %u already set!",
|
||||||
|
flag, offset, type);
|
||||||
|
}
|
||||||
|
|
||||||
hdr.flags |= cpu_to_be16(flag);
|
hdr.flags |= cpu_to_be16(flag);
|
||||||
if (pwrite(gs->fd, &hdr, sizeof(hdr), offset - sizeof(hdr)) != sizeof(hdr))
|
if (pwrite(gs->fd, &hdr, sizeof(hdr), offset - sizeof(hdr)) != sizeof(hdr))
|
||||||
|
|
||||||
status_failed(STATUS_FAIL_INTERNAL_ERROR,
|
status_failed(STATUS_FAIL_INTERNAL_ERROR,
|
||||||
"Failed writing set flags @%"PRIu64": %s",
|
"Failed writing set flags @%"PRIu64": %s",
|
||||||
offset, strerror(errno));
|
offset, strerror(errno));
|
||||||
|
|
Loading…
Add table
Reference in a new issue