| 187 | // Serialize HD keypaths to a stream from a map |
| 188 | template<typename Stream> |
| 189 | void SerializeHDKeypaths(Stream& s, const std::map<CPubKey, std::vector<uint32_t>>& hd_keypaths, uint8_t type) |
| 190 | { |
| 191 | for (auto keypath_pair : hd_keypaths) { |
| 192 | if (!keypath_pair.first.IsValid()) { |
| 193 | throw std::ios_base::failure("Invalid CPubKey being serialized"); |
| 194 | } |
| 195 | SerializeToVector(s, type, MakeSpan(keypath_pair.first)); |
| 196 | WriteCompactSize(s, keypath_pair.second.size() * sizeof(uint32_t)); |
| 197 | for (auto& path : keypath_pair.second) { |
| 198 | s << path; |
| 199 | } |
| 200 | } |
| 201 | } |
| 202 | |
| 203 | /** A structure for PSBTs which contain per-input information */ |
| 204 | struct PSBTInput |
no test coverage detected