From 547b3e30ca6dca36eb29c724cda3a8fa2b1d3836 Mon Sep 17 00:00:00 2001 From: Andrew Chow Date: Tue, 6 Sep 2022 15:56:39 -0400 Subject: [PATCH] psbt: Check subkey_len not key.size() --- src/psbt.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/psbt.h b/src/psbt.h index 585ca67da9..b648418cea 100644 --- a/src/psbt.h +++ b/src/psbt.h @@ -925,7 +925,7 @@ struct PSBTInput { if (!key_lookup.emplace(key).second) { throw std::ios_base::failure("Duplicate Key, explicit value is already provided"); - } else if (key.size() != 1) { + } else if (subkey_len != 1) { throw std::ios_base::failure("Input explicit value is more than one byte type"); } CAmount v; @@ -937,7 +937,7 @@ struct PSBTInput { if (!key_lookup.emplace(key).second) { throw std::ios_base::failure("Duplicate Key, explicit value proof is already provided"); - } else if (key.size() != 1) { + } else if (subkey_len != 1) { throw std::ios_base::failure("Input explicit value proof is more than one byte type"); } s >> m_value_proof; @@ -947,7 +947,7 @@ struct PSBTInput { if (!key_lookup.emplace(key).second) { throw std::ios_base::failure("Duplicate Key, explicit asset is already provided"); - } else if (key.size() != 1) { + } else if (subkey_len != 1) { throw std::ios_base::failure("Input explicit asset is more than one byte type"); } UnserializeFromVector(s, m_explicit_asset); @@ -957,7 +957,7 @@ struct PSBTInput { if (!key_lookup.emplace(key).second) { throw std::ios_base::failure("Duplicate Key, explicit asset proof is already provided"); - } else if (key.size() != 1) { + } else if (subkey_len != 1) { throw std::ios_base::failure("Input explicit asset proof is more than one byte type"); } s >> m_value_proof; @@ -967,7 +967,7 @@ struct PSBTInput { if (!key_lookup.emplace(key).second) { throw std::ios_base::failure("Duplicate Key, issuance needs blinded flag is already provided"); - } else if (key.size() != 1) { + } else if (subkey_len != 1) { throw std::ios_base::failure("Input issuance needs blinded flag is more than one byte type"); } bool b;