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

Function pull_expected_length

common/bolt11.c:152–166  ·  view source on GitHub ↗

If field isn't expected length (in *bech32*!), call unknown_field. * Otherwise copy into dst without padding, set have_flag if non-NULL. */

Source from the content-addressed store, hash-verified

150/* If field isn't expected length (in *bech32*!), call unknown_field.
151 * Otherwise copy into dst without padding, set have_flag if non-NULL. */
152static const char *pull_expected_length(struct bolt11 *b11,
153 struct hash_u5 *hu5,
154 const u5 **data, size_t *field_len,
155 size_t expected_length,
156 u5 type,
157 bool *have_flag,
158 void *dst)
159{
160 if (*field_len != expected_length)
161 return unknown_field(b11, hu5, data, field_len, type);
162
163 if (have_flag)
164 *have_flag = true;
165 return pull_bits(hu5, data, field_len, dst, *field_len * 5, false);
166}
167
168/* BOLT #11:
169 *

Callers 4

decode_pFunction · 0.85
decode_hFunction · 0.85
decode_nFunction · 0.85
decode_sFunction · 0.85

Calls 2

pull_bitsFunction · 0.85
unknown_fieldFunction · 0.70

Tested by

no test coverage detected