In order to get the Unique id for a PSET, the explicit values and assets
need to be used. Since GetUnsignedTx is used to create the tx that is
hashed, modify GetUnsignedTx so that the explicit values and assets are
used when requested.
* Add some fields that were missing in PSBTInput::Merge and PSBTOutput::Merge
* Remove incorrect check that explicit values and assets aren't present
when blinded
* Fix bug in combinepsbt where the condition was inverted
Fetches the PSBTv2 fields from PSBTv0's global unsigned tx. This allows
us to pretend everything internally is a PSBTv2 and makes things easier
to work with.
Reset back to Bitcoin PSBT and disable PSBT/PSET handling in wallet and
rpc.
This is just a reset to allow for PSBTv2 change and then a new and
improved PSET.
Spent a while figuring out where this new function should live now that
the PSBT stuff has been pulled into src/psbt.cpp and the wallet, and isn't
mixed up with the RPC logic.
In the end I modified the the function to return a normal error rather
than throwing an RPC exception and put it in src/psbt.cpp with the other
functions that behave this way.
This fixes a segfault I introduced in 981df590811 (#17371) a couple hundred PRs
ago, where we might out-of-bounds access the vout arrray of a non_witness_utxo
transaction in a PSBT.
This logic should probably be refactored after the rebase -- we sift through
the non_witness_utxos to find a scriptpubkey, which we use to get a wallet
provider, so we can pass this to SignPSBTInput, which then repeats the same
logic (for its own reasons, and without the segfault bug)....and we aren't
even calling SignPSBTInput for signing reasons! It has something to do with
blinding.
Also uncommented a bunch of PSBT functional tests (had to add a fee output
to one transaction, update `find_output` to skip CT outputs, and change two
constant checks at the end of the commented-out section).