| 668 | } |
| 669 | |
| 670 | static 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 */ |
| 703 | static bool map_catchup(struct gossmap *map, |
no test coverage detected