aboutsummaryrefslogtreecommitdiff
path: root/src/psbt.h
diff options
context:
space:
mode:
authorAndrew Chow <github@achow101.com>2023-04-21 13:54:58 -0400
committerAndrew Chow <github@achow101.com>2023-04-21 14:06:12 -0400
commit2755aa5121ac8c83365a8da747c3f0fc8ebae9c6 (patch)
tree5fcc67e84f9ef086cd9f047664b1fcea86c39551 /src/psbt.h
parentf3f5c9712670fc2c9fb3b57580146aa248a5d36f (diff)
parent6e9f8bb050785dbc754b6bb493aad9139908ef98 (diff)
downloadbitcoin-2755aa5121ac8c83365a8da747c3f0fc8ebae9c6.tar.xz
Merge bitcoin/bitcoin#25939: rpc: In `utxoupdatepsbt` also look for the tx in the txindex
6e9f8bb050785dbc754b6bb493aad9139908ef98 rpc, tests: in `utxoupdatepsbt` also look for the transaction in the txindex (ishaanam) a5b4883fb43d01bfef1244df62c64bf8691ca63a rpc: extract psbt updating logic into ProcessPSBT (ishaanam) Pull request description: Previously the `utxoupdatepsbt` RPC, added in #13932, only updated the inputs spending segwit outputs with the `witness_utxo`, because the full transaction is needed for legacy inputs. Before this RPC looked for just the utxos in the utxo set and the mempool. This PR makes it so that if the user has txindex enabled, then the full transaction is looked for there for all inputs. If it is not found in the txindex or txindex isn't enabled, then the mempool is checked for the full transaction. If the transaction an input is spending from is still not found at that point, then the utxo set is searched and the inputs spending segwit outputs are updated with just the utxo. ACKs for top commit: achow101: ACK 6e9f8bb050785dbc754b6bb493aad9139908ef98 Xekyo: ACK 6e9f8bb050785dbc754b6bb493aad9139908ef98 Tree-SHA512: 078db3c37a1ecd5816d80a42e8bd1341e416d661f508fa5fce0f4e1249fefd7b92a0d45f44957781cb69d0953145ef096ecdd4545ada39062be27742402dac6f
Diffstat (limited to 'src/psbt.h')
-rw-r--r--src/psbt.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/psbt.h b/src/psbt.h
index c497584f36..9464b10268 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);