mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 06:41:44 +01:00
devtools: add --print-timestamps to dump-gossipstore.
Allowed me to sanity check the next patch. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
92fe871467
commit
dcf2916dcb
1 changed files with 5 additions and 0 deletions
|
@ -17,10 +17,13 @@ int main(int argc, char *argv[])
|
|||
struct gossip_hdr hdr;
|
||||
size_t off;
|
||||
bool print_deleted = false;
|
||||
bool print_timestamp = false;
|
||||
|
||||
setup_locale();
|
||||
opt_register_noarg("--print-deleted", opt_set_bool, &print_deleted,
|
||||
"Print deleted entries too");
|
||||
opt_register_noarg("--print-timestamps", opt_set_bool, &print_timestamp,
|
||||
"Print timestamp with entries");
|
||||
opt_register_noarg("--help|-h", opt_usage_and_exit,
|
||||
"[<gossip_store>]"
|
||||
"Dump all gossip messages in the store",
|
||||
|
@ -71,6 +74,8 @@ int main(int argc, char *argv[])
|
|||
deleted ? "DELETED " : "",
|
||||
push ? "PUSH " : "",
|
||||
ratelimit ? "RATE-LIMITED " : "");
|
||||
if (print_timestamp)
|
||||
printf("T=%u ", be32_to_cpu(hdr.timestamp));
|
||||
if (deleted && !print_deleted) {
|
||||
printf("\n");
|
||||
goto end;
|
||||
|
|
Loading…
Add table
Reference in a new issue