Skip to content

Commit 547b3e3

Browse files
committed
psbt: Check subkey_len not key.size()
1 parent b4935a5 commit 547b3e3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/psbt.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -925,7 +925,7 @@ struct PSBTInput
925925
{
926926
if (!key_lookup.emplace(key).second) {
927927
throw std::ios_base::failure("Duplicate Key, explicit value is already provided");
928-
} else if (key.size() != 1) {
928+
} else if (subkey_len != 1) {
929929
throw std::ios_base::failure("Input explicit value is more than one byte type");
930930
}
931931
CAmount v;
@@ -937,7 +937,7 @@ struct PSBTInput
937937
{
938938
if (!key_lookup.emplace(key).second) {
939939
throw std::ios_base::failure("Duplicate Key, explicit value proof is already provided");
940-
} else if (key.size() != 1) {
940+
} else if (subkey_len != 1) {
941941
throw std::ios_base::failure("Input explicit value proof is more than one byte type");
942942
}
943943
s >> m_value_proof;
@@ -947,7 +947,7 @@ struct PSBTInput
947947
{
948948
if (!key_lookup.emplace(key).second) {
949949
throw std::ios_base::failure("Duplicate Key, explicit asset is already provided");
950-
} else if (key.size() != 1) {
950+
} else if (subkey_len != 1) {
951951
throw std::ios_base::failure("Input explicit asset is more than one byte type");
952952
}
953953
UnserializeFromVector(s, m_explicit_asset);
@@ -957,7 +957,7 @@ struct PSBTInput
957957
{
958958
if (!key_lookup.emplace(key).second) {
959959
throw std::ios_base::failure("Duplicate Key, explicit asset proof is already provided");
960-
} else if (key.size() != 1) {
960+
} else if (subkey_len != 1) {
961961
throw std::ios_base::failure("Input explicit asset proof is more than one byte type");
962962
}
963963
s >> m_value_proof;
@@ -967,7 +967,7 @@ struct PSBTInput
967967
{
968968
if (!key_lookup.emplace(key).second) {
969969
throw std::ios_base::failure("Duplicate Key, issuance needs blinded flag is already provided");
970-
} else if (key.size() != 1) {
970+
} else if (subkey_len != 1) {
971971
throw std::ios_base::failure("Input issuance needs blinded flag is more than one byte type");
972972
}
973973
bool b;

0 commit comments

Comments
 (0)