Skip to content

Commit

Permalink
gossipd: print stats even if we truncate store.
Browse files Browse the repository at this point in the history
Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell authored and cdecker committed Apr 11, 2018
1 parent 2b8293c commit d5767fb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions gossipd/gossip_store.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -182,4 +179,8 @@ void gossip_store_load(struct routing_state *rstate, struct gossip_store *gs)
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);
}

0 comments on commit d5767fb

Please sign in to comment.