MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / ExcludeIndividualFlags

Function ExcludeIndividualFlags

src/test/transaction_tests.cpp:148–158  ·  view source on GitHub ↗

Exclude each possible script verify flag from flags. Returns a set of these flag combinations that are valid and without duplicates. For example: if flags=1111 and the 4 possible flags are 0001, 0010, 0100, and 1000, this should return the set {0111, 1011, 1101, 1110}. Assumes that mapFlagNames contains all script verify flags.

Source from the content-addressed store, hash-verified

146// 0001, 0010, 0100, and 1000, this should return the set {0111, 1011, 1101, 1110}.
147// Assumes that mapFlagNames contains all script verify flags.
148std::set<script_verify_flags> ExcludeIndividualFlags(script_verify_flags flags)
149{
150 std::set<script_verify_flags> flags_combos;
151 for (const auto& pair : mapFlagNames) {
152 script_verify_flags flags_excluding_one = TrimFlags(flags & ~(pair.second));
153 if (flags != flags_excluding_one) {
154 flags_combos.insert(flags_excluding_one);
155 }
156 }
157 return flags_combos;
158}
159
160BOOST_FIXTURE_TEST_SUITE(transaction_tests, BasicTestingSetup)
161

Callers 1

BOOST_AUTO_TEST_CASEFunction · 0.85

Calls 2

TrimFlagsFunction · 0.85
insertMethod · 0.45

Tested by

no test coverage detected