diff --git a/gossipd/gossip_store.c b/gossipd/gossip_store.c index eb809c062..9f14577c1 100644 --- a/gossipd/gossip_store.c +++ b/gossipd/gossip_store.c @@ -624,10 +624,18 @@ truncate_nomsg: status_failed(STATUS_FAIL_INTERNAL_ERROR, "Truncating store: %s", strerror(errno)); out: + gs->writable = true; + /* If we ever truncated, we might have a dangling channel_announce */ + if (chan_ann) { + struct broadcastable bcast; + bcast.index = chan_ann_off; + status_unusual("Deleting un-updated channel_announcement @%" + PRIu64, chan_ann_off); + gossip_store_delete(gs, &bcast, WIRE_CHANNEL_ANNOUNCEMENT); + } status_trace("total store load time: %"PRIu64" msec", time_to_msec(time_between(time_now(), start))); status_trace("gossip_store: Read %zu/%zu/%zu/%zu cannounce/cupdate/nannounce/cdelete from store (%zu deleted) in %"PRIu64" bytes", stats[0], stats[1], stats[2], stats[3], gs->deleted, gs->len); - gs->writable = true; }