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

Function get_cupdate_parts

connectd/queries.c:429–450  ·  view source on GitHub ↗

Helper to get non-signature, non-timestamp parts of (valid!) channel_update */

Source from the content-addressed store, hash-verified

427
428/* Helper to get non-signature, non-timestamp parts of (valid!) channel_update */
429static void get_cupdate_parts(const u8 *channel_update,
430 const u8 *parts[2],
431 size_t sizes[2])
432{
433 /* BOLT #7:
434 *
435 * 1. type: 258 (`channel_update`)
436 * 2. data:
437 * * [`signature`:`signature`]
438 * * [`chain_hash`:`chain_hash`]
439 * * [`short_channel_id`:`short_channel_id`]
440 * * [`u32`:`timestamp`]
441 *...
442 */
443 /* Note: 2 bytes for `type` field */
444 /* We already checked it's valid before accepting */
445 assert(tal_count(channel_update) > 2 + 64 + 32 + 8 + 4);
446 parts[0] = channel_update + 2 + 64;
447 sizes[0] = 32 + 8;
448 parts[1] = channel_update + 2 + 64 + 32 + 8 + 4;
449 sizes[1] = tal_count(channel_update) - (64 + 2 + 32 + 8 + 4);
450}
451
452/* BOLT #7:
453 *

Callers 1

crc32_of_updateFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected