MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / SerializeHDKeypaths

Function SerializeHDKeypaths

src/script/sign.h:189–201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

187// Serialize HD keypaths to a stream from a map
188template<typename Stream>
189void 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 */
204struct PSBTInput

Callers 2

SerializeMethod · 0.85
SerializeMethod · 0.85

Calls 5

SerializeToVectorFunction · 0.85
MakeSpanFunction · 0.85
WriteCompactSizeFunction · 0.85
IsValidMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected