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

Function feature_set_for_feature

common/features.c:197–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

195}
196
197struct feature_set *feature_set_for_feature(const tal_t *ctx, int feature)
198{
199 struct feature_set *fs = tal(ctx, struct feature_set);
200
201 for (size_t i = 0; i < ARRAY_SIZE(fs->bits); i++) {
202 fs->bits[i] = tal_arr(fs, u8, 0);
203 switch (feature_copy_style(feature, i)) {
204 case FEATURE_DONT_REPRESENT:
205 continue;
206 case FEATURE_REPRESENT:
207 set_feature_bit(&fs->bits[i], feature);
208 continue;
209 case FEATURE_REPRESENT_AS_OPTIONAL:
210 set_feature_bit(&fs->bits[i], OPTIONAL_FEATURE(feature));
211 continue;
212 }
213 abort();
214 }
215 return fs;
216}
217
218bool feature_set_or(struct feature_set *a,
219 const struct feature_set *b TAKES)

Callers 8

opt_force_featuresetFunction · 0.85
opt_set_dual_fundFunction · 0.85
opt_set_splicingFunction · 0.85
handle_early_optsFunction · 0.85
default_featuresFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85

Calls 3

set_feature_bitFunction · 0.85
abortFunction · 0.85
feature_copy_styleFunction · 0.70

Tested by 2

mainFunction · 0.68
mainFunction · 0.68