MCPcopy Create free account
hub / github.com/ElementsProject/lightning / report_dying_cb

Function report_dying_cb

common/gossmap.c:670–700  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

668}
669
670static bool report_dying_cb(struct gossmap *map,
671 u64 dying_off,
672 u16 msglen,
673 void (*dyingcb)(struct short_channel_id scid,
674 u32 blockheight,
675 u64 offset,
676 void *cb_arg),
677 void *cb_arg)
678{
679 struct short_channel_id scid;
680 u32 blockheight;
681 u8 *msg;
682
683 msg = tal_arr(NULL, u8, msglen);
684 map_copy(map, dying_off, msg, msglen);
685
686 if (!fromwire_gossip_store_chan_dying(msg, &scid, &blockheight)) {
687 map->logcb(map->cbarg,
688 LOG_BROKEN,
689 "Invalid chan_dying message @%"PRIu64
690 "/%"PRIu64": %s",
691 dying_off, map->map_size, msglen,
692 tal_hex(tmpctx, msg));
693 tal_free(msg);
694 return false;
695 }
696 tal_free(msg);
697
698 dyingcb(scid, blockheight, dying_off, cb_arg);
699 return true;
700}
701
702/* Mutual recursion */
703static bool map_catchup(struct gossmap *map,

Callers 1

map_catchupFunction · 0.85

Calls 4

map_copyFunction · 0.85
tal_hexFunction · 0.85
tal_freeFunction · 0.85

Tested by

no test coverage detected