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

Function get_checksum_and_timestamp

gossipd/queries.c:351–366  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

349}
350
351static void get_checksum_and_timestamp(struct routing_state *rstate,
352 const struct chan *chan,
353 int direction,
354 u32 *tstamp, u32 *csum)
355{
356 const struct half_chan *hc = &chan->half[direction];
357
358 if (!is_chan_public(chan) || !is_halfchan_defined(hc)) {
359 *tstamp = *csum = 0;
360 } else {
361 const u8 *update = gossip_store_get(tmpctx, rstate->gs,
362 hc->bcast.index);
363 *tstamp = hc->bcast.timestamp;
364 *csum = crc32_of_update(update);
365 }
366}
367
368/* FIXME: This assumes that the tlv type encodes into 1 byte! */
369static size_t tlv_overhead(size_t num_entries, size_t size)

Callers 1

gather_rangeFunction · 0.85

Calls 4

is_chan_publicFunction · 0.85
is_halfchan_definedFunction · 0.85
gossip_store_getFunction · 0.70
crc32_of_updateFunction · 0.70

Tested by

no test coverage detected