gossmap: don't spew to stderr, include counter for callers.

Fixes: #4722
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Fixed: Plugins: don't drop complaints about silly channels to stderr.
This commit is contained in:
Rusty Russell
2021-08-20 13:42:27 +09:30
parent c970195b93
commit cf1dd779d1
11 changed files with 70 additions and 42 deletions

View File

@@ -71,6 +71,7 @@ int main(int argc, char *argv[])
struct gossmap *map;
struct node_id dstid;
bool clean_topology = false;
size_t num_channel_updates_rejected;
opt_register_noarg("--clean-topology", opt_set_bool, &clean_topology,
"Clean up topology before run");
@@ -83,13 +84,14 @@ int main(int argc, char *argv[])
opt_usage_exit_fail("Expect 3 arguments");
tstart = time_mono();
map = gossmap_load(NULL, argv[1]);
map = gossmap_load(NULL, argv[1], &num_channel_updates_rejected);
if (!map)
err(1, "Loading gossip store %s", argv[1]);
tstop = time_mono();
printf("# Time to load: %"PRIu64" msec\n",
time_to_msec(timemono_between(tstop, tstart)));
printf("# Time to load: %"PRIu64" msec (%zu ignored)\n",
time_to_msec(timemono_between(tstop, tstart)),
num_channel_updates_rejected);
if (clean_topology)
clean_topo(map, false);