mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-02 12:44:26 +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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user