gossipd: print stats even if we truncate store.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2018-04-11 08:33:35 +09:30 committed by Christian Decker
parent 2b8293c9f6
commit d5767fb3bb

View File

@ -170,10 +170,7 @@ void gossip_store_load(struct routing_state *rstate, struct gossip_store *gs)
known_good += sizeof(belen) + msglen;
tal_free(msg);
}
status_trace("gossip_store: Read %zu/%zu/%zu/%zu cannounce/cupdate/nannounce/cdelete from store in %"PRIu64" bytes",
stats[0], stats[1], stats[2], stats[3],
(u64)known_good);
return;
goto out;
truncate:
status_unusual("gossip_store: %s (%s) truncating to %"PRIu64,
@ -182,4 +179,8 @@ truncate_nomsg:
if (ftruncate(gs->fd, known_good) != 0)
status_failed(STATUS_FAIL_INTERNAL_ERROR,
"Truncating store: %s", strerror(errno));
out:
status_trace("gossip_store: Read %zu/%zu/%zu/%zu cannounce/cupdate/nannounce/cdelete from store in %"PRIu64" bytes",
stats[0], stats[1], stats[2], stats[3],
(u64)known_good);
}