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

Function CreatePAKListFromExtensionSpace

src/primitives/pak.cpp:166–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

164}
165
166CPAKList CreatePAKListFromExtensionSpace(const std::vector<std::vector<unsigned char>>& extension_space)
167{
168 CPAKList paklist;
169 std::vector<std::vector<unsigned char>> offline_keys;
170 std::vector<std::vector<unsigned char>> online_keys;
171 for (const auto& entry : extension_space) {
172 if (entry.size() != 66) {
173 return CPAKList();
174 }
175 // Dumbly tries to extract two pubkeys, relies on FromBytes to parse/validate
176 offline_keys.emplace_back(entry.begin(), entry.begin()+33);
177 online_keys.emplace_back(entry.begin()+33, entry.end());
178 }
179 if (!CPAKList::FromBytes(paklist, offline_keys, online_keys)) {
180 return CPAKList();
181 }
182 return paklist;
183}
184
185CPAKList GetActivePAKList(const CBlockIndex* pblockindex, const Consensus::Params& params)
186{

Callers 3

AppInitMainFunction · 0.85
GetActivePAKListFunction · 0.85

Calls 6

CPAKListClass · 0.85
FromBytesFunction · 0.85
emplace_backMethod · 0.80
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected