Skip to content

Commit 1350194

Browse files
rustyrussellcdecker
authored andcommitted
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: #7051 Signed-off-by: Rusty Russell <[email protected]>
1 parent e7f1f29 commit 1350194

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

gossipd/gossip_store.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,9 +509,14 @@ u64 gossip_store_set_flag(struct gossip_store *gs,
509509
if (!check_msg_type(gs, offset, flag, type, &hdr))
510510
return offset;
511511

512-
assert((be16_to_cpu(hdr.flags) & flag) == 0);
512+
if (be16_to_cpu(hdr.flags) & flag) {
513+
status_broken("gossip_store flag-%u @%"PRIu64" for %u already set!",
514+
flag, offset, type);
515+
}
516+
513517
hdr.flags |= cpu_to_be16(flag);
514518
if (pwrite(gs->fd, &hdr, sizeof(hdr), offset - sizeof(hdr)) != sizeof(hdr))
519+
515520
status_failed(STATUS_FAIL_INTERNAL_ERROR,
516521
"Failed writing set flags @%"PRIu64": %s",
517522
offset, strerror(errno));

0 commit comments

Comments
 (0)