| 163 | // Deserialize an individual HD keypath to a stream |
| 164 | template<typename Stream> |
| 165 | void DeserializeHDKeypath(Stream& s, KeyOriginInfo& hd_keypath) |
| 166 | { |
| 167 | // Read in key path |
| 168 | uint64_t value_len = ReadCompactSize(s); |
| 169 | if (value_len % 4 || value_len == 0) { |
| 170 | throw std::ios_base::failure("Invalid length for HD key path"); |
| 171 | } |
| 172 | |
| 173 | s >> hd_keypath.fingerprint; |
| 174 | for (unsigned int i = 4; i < value_len; i += sizeof(uint32_t)) { |
| 175 | uint32_t index; |
| 176 | s >> index; |
| 177 | hd_keypath.path.push_back(index); |
| 178 | } |
| 179 | } |
| 180 | |
| 181 | // Deserialize HD keypaths into a map |
| 182 | template<typename Stream> |
no test coverage detected