Skip to content

Commit

Permalink
Merge ed31d22 into merged_master (Elements PR ElementsProject#1165)
Browse files Browse the repository at this point in the history
  • Loading branch information
gwillen committed Mar 1, 2023
2 parents a04d6f3 + ed31d22 commit f3332ba
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/psbt.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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);
Expand All @@ -957,17 +957,17 @@ 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;
s >> m_asset_proof;
break;
}
case PSBT_ELEMENTS_IN_BLINDED_ISSUANCE:
{
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;
Expand Down Expand Up @@ -1028,7 +1028,7 @@ struct PSBTInput
if ((m_explicit_value.has_value() || !m_value_proof.empty()) && (!m_explicit_value.has_value() || m_value_proof.empty())) {
throw std::ios_base::failure("Input explicit value and value proof must be provided together");
}
if ((!m_explicit_asset.IsNull() || !m_asset_proof.empty()) && (!m_explicit_asset.IsNull() || m_asset_proof.empty())) {
if ((!m_explicit_asset.IsNull() || !m_asset_proof.empty()) && (m_explicit_asset.IsNull() || m_asset_proof.empty())) {
throw std::ios_base::failure("Input explicit asset and asset proof must be provided together");
}
}
Expand Down
Loading

0 comments on commit f3332ba

Please sign in to comment.