| 349 | } |
| 350 | |
| 351 | static 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! */ |
| 369 | static size_t tlv_overhead(size_t num_entries, size_t size) |
no test coverage detected