Add details to PSBT
This commit is contained in:
parent
7e61659cb7
commit
2ac26fa060
@ -193,6 +193,7 @@ impl Progress for BdkProgressHolder {
|
|||||||
|
|
||||||
struct PartiallySignedBitcoinTransaction {
|
struct PartiallySignedBitcoinTransaction {
|
||||||
internal: Mutex<PartiallySignedTransaction>,
|
internal: Mutex<PartiallySignedTransaction>,
|
||||||
|
details: bdk::TransactionDetails,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl PartiallySignedBitcoinTransaction {
|
impl PartiallySignedBitcoinTransaction {
|
||||||
@ -205,7 +206,7 @@ impl PartiallySignedBitcoinTransaction {
|
|||||||
let wallet = online_wallet.get_wallet();
|
let wallet = online_wallet.get_wallet();
|
||||||
match Address::from_str(&recipient) {
|
match Address::from_str(&recipient) {
|
||||||
Ok(address) => {
|
Ok(address) => {
|
||||||
let (psbt, _) = {
|
let (psbt, details) = {
|
||||||
let mut builder = wallet.build_tx();
|
let mut builder = wallet.build_tx();
|
||||||
builder.add_recipient(address.script_pubkey(), amount);
|
builder.add_recipient(address.script_pubkey(), amount);
|
||||||
if let Some(sat_per_vb) = fee_rate {
|
if let Some(sat_per_vb) = fee_rate {
|
||||||
@ -215,6 +216,7 @@ impl PartiallySignedBitcoinTransaction {
|
|||||||
};
|
};
|
||||||
Ok(PartiallySignedBitcoinTransaction {
|
Ok(PartiallySignedBitcoinTransaction {
|
||||||
internal: Mutex::new(psbt),
|
internal: Mutex::new(psbt),
|
||||||
|
details,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
Err(..) => Err(BdkError::Generic(
|
Err(..) => Err(BdkError::Generic(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user