features: add 'feature_bit_sub', which will subtract/unset bits

Given a two sets of featurebits, unset the featurebits in the first set
that are set in the second set
This commit is contained in:
niftynei
2020-10-22 13:18:38 -05:00
committed by neil saitug
parent 0871bf0999
commit ddc9500a64
3 changed files with 66 additions and 0 deletions

View File

@@ -32,6 +32,10 @@ void towire_feature_set(u8 **pptr, const struct feature_set *fset);
bool feature_set_or(struct feature_set *a,
const struct feature_set *b TAKES);
/* a - b, or returns false if features not already in a */
bool feature_set_sub(struct feature_set *a,
const struct feature_set *b TAKES);
/* Returns -1 if we're OK with all these offered features, otherwise first
* unsupported (even) feature. */
int features_unsupported(const struct feature_set *our_features,