mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-05-13 07:23:21 +02:00
Replace PSBT.tx with PSBT::GetUnsignedTx and PSBT::GetUniqueID
The global unsigned tx is decomposed into separate fields inside of PSBT, which mirrors what PSBTv2 will do. However, we still need to get the global unsigned tx so PSBT::GetUnsignedTx is introduced to do that. In order to also have a stable unique ID, we also introduce PSBT::GetUniqueID to replace uses of PSBT.tx.GetHash().
This commit is contained in:
@@ -18,6 +18,13 @@ PSBTAnalysis AnalyzePSBT(PartiallySignedTransaction psbtx)
|
||||
// Go through each input and build status
|
||||
PSBTAnalysis result;
|
||||
|
||||
std::optional<CMutableTransaction> unsigned_tx = psbtx.GetUnsignedTx();
|
||||
if (!unsigned_tx) {
|
||||
result.SetInvalid("PSBT cannot be made into a valid transaction");
|
||||
return result;
|
||||
}
|
||||
CMutableTransaction& mtx = *unsigned_tx;
|
||||
|
||||
bool calc_fee = true;
|
||||
|
||||
CAmount in_amt = 0;
|
||||
@@ -116,7 +123,6 @@ PSBTAnalysis AnalyzePSBT(PartiallySignedTransaction psbtx)
|
||||
result.fee = fee;
|
||||
|
||||
// Estimate the size
|
||||
CMutableTransaction mtx(*psbtx.tx);
|
||||
CCoinsViewCache view{&CoinsViewEmpty::Get()};
|
||||
bool success = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user