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

Function get_checksum

connectd/queries.c:499–509  ·  view source on GitHub ↗

BOLT #7: * Where: * * `checksum_node_id_1` is the checksum of the `channel_update` for * `node_id_1`, or 0 if there was no `channel_update` from that * node. * * `checksum_node_id_2` is the checksum of the `channel_update` for * `node_id_2`, or 0 if there was no `channel_update` from that * node. */

Source from the content-addressed store, hash-verified

497 * node.
498 */
499static u32 get_checksum(struct gossmap *gossmap,
500 const struct gossmap_chan *chan,
501 int dir)
502{
503 u8 *cupdate;
504
505 cupdate = gossmap_chan_get_update(tmpctx, gossmap, chan, dir);
506 if (!cupdate)
507 return 0;
508 return crc32_of_update(cupdate);
509}
510
511
512/* FIXME: This assumes that the tlv type encodes into 1 byte! */

Callers 1

gather_rangeFunction · 0.85

Calls 2

gossmap_chan_get_updateFunction · 0.85
crc32_of_updateFunction · 0.70

Tested by

no test coverage detected