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

Function check_features_and_chain

common/bolt12.c:51–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51static char *check_features_and_chain(const tal_t *ctx,
52 const struct feature_set *our_features,
53 const struct chainparams *must_be_chain,
54 const u8 *features,
55 const struct bitcoin_blkid *chains,
56 size_t num_chains)
57{
58 if (must_be_chain) {
59 if (!bolt12_chains_match(chains, num_chains, must_be_chain))
60 return tal_fmt(ctx, "wrong chain");
61 }
62
63 if (our_features) {
64 int badf = features_unsupported(our_features, features,
65 BOLT11_FEATURE);
66 if (badf != -1)
67 return tal_fmt(ctx, "unknown feature bit %i", badf);
68 }
69
70 return NULL;
71}
72
73bool bolt12_check_signature(const struct tlv_field *fields,
74 const char *messagename,

Callers 3

offer_decodeFunction · 0.85
invrequest_decodeFunction · 0.85
invoice_decode_nosigFunction · 0.85

Calls 2

bolt12_chains_matchFunction · 0.85
features_unsupportedFunction · 0.70

Tested by

no test coverage detected