Allow value commitments instead of explicit value

It is not invalid to have a value commitment and no explicit value. It
is only invalid to have neither for an output.
This commit is contained in:
Andrew Chow 2021-04-19 15:01:20 -04:00
parent 2c0cee5a20
commit c0cb623acc

View file

@ -1223,7 +1223,7 @@ struct PSBTOutput
// Make sure required PSBTv2 fields are present
if (m_psbt_version >= 2) {
if (amount == nullopt) {
if (amount == nullopt && m_value_commitment.IsNull()) {
throw std::ios_base::failure("Output amount is required in PSBTv2");
}
if (script == nullopt) {