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

Function next_field_create

common/bolt12_proof.c:21–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19};
20
21static const struct tlv_field *next_field_create(bool *is_omitted,
22 struct creator *creator)
23{
24 if (creator->n_inv >= tal_count(creator->inv->fields))
25 return NULL;
26 /* If all included fields consumed, remaining must be omitted */
27 if (creator->n_included >= tal_count(creator->included))
28 *is_omitted = true;
29 else
30 *is_omitted = (creator->inv->fields[creator->n_inv].numtype
31 != creator->included[creator->n_included].numtype);
32
33 if (!*is_omitted)
34 creator->n_included++;
35 return &creator->inv->fields[creator->n_inv++];
36}
37
38/* BOLT-payer_proof #12:
39 * - MUST populate `proof_missing_hashes` with the merkle hash of the omitted branch

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected