devtools/create-gossipstore: add --max option to create reduced testsets.

eg. for running under valgrind.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2019-04-08 09:26:29 +09:30
parent b017caaadf
commit 6dd1dacb9c

View File

@@ -42,6 +42,7 @@ int main(int argc, char *argv[])
int infd, outfd;
FILE * scidfd;
struct scidsat * scids;
unsigned max = -1U;
setup_locale();
@@ -55,6 +56,8 @@ int main(int argc, char *argv[])
"Input for 'scid, satshis' csv");
opt_register_arg("--sat", opt_set_charp, NULL, &csat,
"default satoshi value if --scidfile flag not present");
opt_register_arg("--max", opt_set_uintval, opt_show_uintval, &max,
"maximum number of messages to read");
opt_register_noarg("--help|-h", opt_usage_and_exit,
"Create gossip store, from be16 / input messages",
"Print this message.");
@@ -144,6 +147,8 @@ int main(int argc, char *argv[])
exit(1);
}
tal_free(inmsg);
if (--max == 0)
break;
}
fprintf(stderr, "channels %d, updates %d, nodes %d\n", channels, updates, nodes);
if (scidfile)