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

Function trim_features

common/features.c:173–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171};
172
173static void trim_features(u8 **features)
174{
175 size_t trim, len = tal_bytelen(*features);
176
177 /* Don't try to tal_resize a NULL array */
178 if (len == 0)
179 return;
180
181 /* Big-endian bitfields are weird, but it means we trim
182 * from the front: */
183 for (trim = 0; trim < len && (*features)[trim] == 0; trim++);
184 memmove(*features, *features + trim, len - trim);
185 tal_resize(features, len - trim);
186}
187
188static void clear_feature_bit(u8 *features, u32 bit)
189{

Callers 4

feature_set_subFunction · 0.85
featurebits_unsetFunction · 0.85
test_feature_trimFunction · 0.85

Calls 1

tal_bytelenFunction · 0.85

Tested by 1

test_feature_trimFunction · 0.68