According to the consensus validation rules, we must supple Null values for issunace/reissuance instead of explicit zero. However, the current code for tries does something else:
|
if (input.m_issuance_value != std::nullopt && input.m_issuance_inflation_keys_amount != std::nullopt && force_unblinded) { |
|
txin.assetIssuance.nAmount.SetToAmount(*input.m_issuance_value); |
|
txin.assetIssuance.nInflationKeys.SetToAmount(*input.m_issuance_inflation_keys_amount); |
|
} else { |
|
txin.assetIssuance.nAmount = input.m_issuance_value_commitment; |
|
txin.assetIssuance.nInflationKeys = input.m_issuance_inflation_keys_commitment; |
|
} |
Fix would be to have
- two separate if else statements for issunace/re-issuance.
- force_unblinded is always used. There is no way to do explicit issuances in the current pset workflow.
This calculation causes walletprocesspsbt to create signatures that do not validate because the sighash is calculated incorrectly.