| 216 | // Serialize HD keypaths to a stream from a map |
| 217 | template<typename Stream> |
| 218 | void SerializeHDKeypaths(Stream& s, const std::map<CPubKey, KeyOriginInfo>& hd_keypaths, CompactSizeWriter type) |
| 219 | { |
| 220 | for (auto keypath_pair : hd_keypaths) { |
| 221 | if (!keypath_pair.first.IsValid()) { |
| 222 | throw std::ios_base::failure("Invalid CPubKey being serialized"); |
| 223 | } |
| 224 | SerializeToVector(s, type, Span(keypath_pair.first)); |
| 225 | SerializeHDKeypath(s, keypath_pair.second); |
| 226 | } |
| 227 | } |
| 228 | |
| 229 | /** A structure for PSBTs which contain per-input information */ |
| 230 | struct PSBTInput |