Skip to content

Commit d1a6649

Browse files
committed
gossmap-compress: warn about updates which we don't include in map.
There are some, they're unusable high-fee. Signed-off-by: Rusty Russell <[email protected]>
1 parent 01b65d1 commit d1a6649

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

devtools/gossmap-compress.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,18 @@ static const char *get_alias(const tal_t *ctx,
517517
return tal_strndup(ctx, (const char *)alias, 32);
518518
}
519519

520+
static void cupdate_bad(struct gossmap *map,
521+
const struct short_channel_id_dir *scidd,
522+
u16 cltv_expiry_delta,
523+
u32 fee_base_msat,
524+
u32 fee_proportional_millionths,
525+
void *unused)
526+
{
527+
warnx("Bad cupdate for %s, ignoring (delta=%u, fee=%u/%u)",
528+
fmt_short_channel_id_dir(tmpctx, scidd),
529+
cltv_expiry_delta, fee_base_msat, fee_proportional_millionths);
530+
}
531+
520532
int main(int argc, char *argv[])
521533
{
522534
int infd, outfd;
@@ -559,7 +571,7 @@ int main(int argc, char *argv[])
559571
bool *dirs;
560572
gzFile outf = gzdopen(outfd, "wb9");
561573

562-
struct gossmap *gossmap = gossmap_load_fd(tmpctx, infd, NULL, NULL, NULL);
574+
struct gossmap *gossmap = gossmap_load_fd(tmpctx, infd, cupdate_bad, NULL, NULL);
563575
if (!gossmap)
564576
opt_usage_and_exit("Cannot read gossmap");
565577

0 commit comments

Comments
 (0)