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

Function CountXpubs

src/test/descriptor_tests.cpp:80–89  ·  view source on GitHub ↗

Count the number of times the string "xpub" appears in a descriptor string

Source from the content-addressed store, hash-verified

78
79// Count the number of times the string "xpub" appears in a descriptor string
80static size_t CountXpubs(const std::string& desc)
81{
82 size_t count = 0;
83 size_t p = desc.find("xpub", 0);
84 while (p != std::string::npos) {
85 count++;
86 p = desc.find("xpub", p + 1);
87 }
88 return count;
89}
90
91const std::set<std::vector<uint32_t>> ONLY_EMPTY{{}};
92

Callers 1

DoCheckFunction · 0.85

Calls 1

findMethod · 0.80

Tested by

no test coverage detected