From 6e9f8bb050785dbc754b6bb493aad9139908ef98 Mon Sep 17 00:00:00 2001 From: ishaanam Date: Tue, 23 Aug 2022 15:24:00 -0400 Subject: rpc, tests: in `utxoupdatepsbt` also look for the transaction in the txindex Previously only the segwit utxos being spent by the psbt were looked for and added to the psbt. Now, the full transaction corresponding to each of these utxos (legacy and segwit) is looked for in the txindex and mempool and added to the psbt. If txindex is disabled and the transaction is not in the mempool, then we fall back to getting just the utxo (if segwit) from the utxo set. --- src/psbt.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/psbt.h') diff --git a/src/psbt.h b/src/psbt.h index 40d69cd454..0a581933f0 100644 --- a/src/psbt.h +++ b/src/psbt.h @@ -1231,6 +1231,9 @@ bool PSBTInputSignedAndVerified(const PartiallySignedTransaction psbt, unsigned **/ bool SignPSBTInput(const SigningProvider& provider, PartiallySignedTransaction& psbt, int index, const PrecomputedTransactionData* txdata, int sighash = SIGHASH_ALL, SignatureData* out_sigdata = nullptr, bool finalize = true); +/** Reduces the size of the PSBT by dropping unnecessary `non_witness_utxos` (i.e. complete previous transactions) from a psbt when all inputs are segwit v1. */ +void RemoveUnnecessaryTransactions(PartiallySignedTransaction& psbtx, const int& sighash_type); + /** Counts the unsigned inputs of a PSBT. */ size_t CountPSBTUnsignedInputs(const PartiallySignedTransaction& psbt); -- cgit v1.2.3