mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-05-09 19:31:13 +02:00
Throw error if CPubKey is invalid during PSBT keypath serialization
This commit is contained in:
parent
6b8d0a2164
commit
4e4de10f69
@ -206,6 +206,9 @@ template<typename Stream>
|
||||
void SerializeHDKeypaths(Stream& s, const std::map<CPubKey, KeyOriginInfo>& hd_keypaths, uint8_t type)
|
||||
{
|
||||
for (auto keypath_pair : hd_keypaths) {
|
||||
if (!keypath_pair.first.IsValid()) {
|
||||
throw std::ios_base::failure("Invalid CPubKey being serialized");
|
||||
}
|
||||
SerializeToVector(s, type, MakeSpan(keypath_pair.first));
|
||||
WriteCompactSize(s, (keypath_pair.second.path.size() + 1) * sizeof(uint32_t));
|
||||
s << keypath_pair.second.fingerprint;
|
||||
|
Loading…
x
Reference in New Issue
Block a user