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

Function trim_features

common/features.c:163–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161};
162
163static void trim_features(u8 **features)
164{
165 size_t trim, len = tal_bytelen(*features);
166
167 /* Don't try to tal_resize a NULL array */
168 if (len == 0)
169 return;
170
171 /* Big-endian bitfields are weird, but it means we trim
172 * from the front: */
173 for (trim = 0; trim < len && (*features)[trim] == 0; trim++);
174 memmove(*features, *features + trim, len - trim);
175 tal_resize(features, len - trim);
176}
177
178static void clear_feature_bit(u8 *features, u32 bit)
179{

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