| 52 | } |
| 53 | |
| 54 | static char *check_features_and_chain(const tal_t *ctx, |
| 55 | const struct feature_set *our_features, |
| 56 | const struct chainparams *must_be_chain, |
| 57 | const u8 *features, |
| 58 | enum feature_place fplace, |
| 59 | const struct bitcoin_blkid *chains, |
| 60 | size_t num_chains) |
| 61 | { |
| 62 | if (must_be_chain) { |
| 63 | if (!bolt12_chains_match(chains, num_chains, must_be_chain)) |
| 64 | return tal_fmt(ctx, "wrong chain"); |
| 65 | } else { |
| 66 | /* Chains is *empty*, that can never work. */ |
| 67 | if (chains && tal_count(chains) == 0) |
| 68 | return tal_fmt(ctx, "offer_chains with zero entries"); |
| 69 | } |
| 70 | |
| 71 | if (our_features) { |
| 72 | int badf = features_unsupported(our_features, features, fplace); |
| 73 | if (badf != -1) |
| 74 | return tal_fmt(ctx, "unknown feature bit %i", badf); |
| 75 | } |
| 76 | |
| 77 | return NULL; |
| 78 | } |
| 79 | |
| 80 | bool bolt12_check_signature(const struct tlv_field *fields, |
| 81 | const char *messagename, |
no test coverage detected