Clean up extract_tx method on PSBT

This commit is contained in:
thunderbiscuit 2023-03-23 13:14:48 -04:00
parent f003a6275e
commit 35d8fb3139
No known key found for this signature in database
GPG Key ID: 88253696EB836462

View File

@ -1,4 +1,3 @@
use bdk::bitcoin::consensus::serialize;
use bdk::bitcoin::hashes::hex::ToHex; use bdk::bitcoin::hashes::hex::ToHex;
use bdk::bitcoin::util::psbt::PartiallySignedTransaction as BdkPartiallySignedTransaction; use bdk::bitcoin::util::psbt::PartiallySignedTransaction as BdkPartiallySignedTransaction;
use bdk::psbt::PsbtUtils; use bdk::psbt::PsbtUtils;
@ -35,8 +34,9 @@ impl PartiallySignedTransaction {
/// Return the transaction. /// Return the transaction.
pub(crate) fn extract_tx(&self) -> Arc<Transaction> { pub(crate) fn extract_tx(&self) -> Arc<Transaction> {
let tx = self.internal.lock().unwrap().clone().extract_tx(); let tx = self.internal.lock().unwrap().clone().extract_tx();
let buffer: Vec<u8> = serialize(&tx); Arc::new(tx.into())
Arc::new(Transaction::new(buffer).unwrap()) // let buffer: Vec<u8> = serialize(&tx);
// Arc::new(Transaction::new(buffer).unwrap())
} }
/// Combines this PartiallySignedTransaction with other PSBT as described by BIP 174. /// Combines this PartiallySignedTransaction with other PSBT as described by BIP 174.