| 164 | } |
| 165 | |
| 166 | CPAKList 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 | |
| 185 | CPAKList GetActivePAKList(const CBlockIndex* pblockindex, const Consensus::Params& params) |
| 186 | { |
no test coverage detected