mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 15:19:07 +01:00
Throw error if CPubKey is invalid during PSBT keypath serialization
Github-Pull: #14690
Rebased-From: 4e4de10f69
This commit is contained in:
committed by
fanquake
parent
de5e48a461
commit
5782fdcd8c
@@ -188,6 +188,9 @@ template<typename Stream>
|
||||
void SerializeHDKeypaths(Stream& s, const std::map<CPubKey, std::vector<uint32_t>>& 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.size() * sizeof(uint32_t));
|
||||
for (auto& path : keypath_pair.second) {
|
||||
|
||||
Reference in New Issue
Block a user