gossip_store: don't copy old delete markers on startup compact.

So we don't have to handle them at load time, either.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2020-10-20 14:28:06 +10:30
parent 30bf6706b7
commit bb9ad57a03

View file

@ -218,6 +218,13 @@ static u32 gossip_store_compact_offline(void)
msg, msglen));
}
/* Don't write out old tombstones */
if (fromwire_peektype(msg) == WIRE_GOSSIP_STORE_DELETE_CHAN) {
deleted++;
tal_free(msg);
continue;
}
if (!write_all(new_fd, &hdr, sizeof(hdr))
|| !write_all(new_fd, msg, msglen)) {
status_broken("gossip_store_compact_offline: writing msg len %zu to new store: %s",
@ -790,9 +797,6 @@ u32 gossip_store_load(struct routing_state *rstate, struct gossip_store *gs)
goto badmsg;
}
break;
case WIRE_GOSSIP_STORE_DELETE_CHAN:
/* No need to copy these */
break;
default:
bad = "Unknown message";
goto badmsg;