MCPcopy Create free account
hub / github.com/ElementsProject/elements / ExcludeIndividualFlags

Function ExcludeIndividualFlags

src/test/transaction_tests.cpp:179–189  ·  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

177// 0001, 0010, 0100, and 1000, this should return the set {0111, 1011, 1101, 1110}.
178// Assumes that mapFlagNames contains all script verify flags.
179std::set<unsigned int> ExcludeIndividualFlags(unsigned int flags)
180{
181 std::set<unsigned int> flags_combos;
182 for (const auto& pair : mapFlagNames) {
183 const unsigned int flags_excluding_one = TrimFlags(flags & ~(pair.second));
184 if (flags != flags_excluding_one) {
185 flags_combos.insert(flags_excluding_one);
186 }
187 }
188 return flags_combos;
189}
190
191BOOST_FIXTURE_TEST_SUITE(transaction_tests, BasicTestingSetup)
192

Callers 1

BOOST_AUTO_TEST_CASEFunction · 0.85

Calls 2

TrimFlagsFunction · 0.85
insertMethod · 0.45

Tested by

no test coverage detected