18 const size_t bitfield_size = (size + 7) / 8;
19 if (vch.size() != bitfield_size) {
24 for (
size_t i = 0; i < bitfield_size; i++) {
26 bitfield |= uint32_t(vch[i]) << (8 * i);
29 const uint32_t mask = (uint64_t(1) << size) - 1;
30 if ((bitfield & mask) != bitfield) {
bool DecodeBitfield(const std::vector< uint8_t > &vch, unsigned size, uint32_t &bitfield, ScriptError *serror)