From c0cb623acc012acaa6f2936a6cb6cbfe6d16b0d2 Mon Sep 17 00:00:00 2001 From: Andrew Chow Date: Mon, 19 Apr 2021 15:01:20 -0400 Subject: [PATCH] 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. --- src/psbt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/psbt.h b/src/psbt.h index 826d8dd05a..3498a7dc1e 100644 --- a/src/psbt.h +++ b/src/psbt.h @@ -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) {