Skip to content

Commit 5ccd956

Browse files
authored
Find additionalfeeoutputindex from unsigned_psbt (#309)
outputs map does not contain the script_pubkey, usigned_tx txos do. PSBTv2 NOW!
1 parent fe923c8 commit 5ccd956

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/bitcoin/payment.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,14 @@ pub async fn create_payjoin(
8787
info!("Original PSBT successfully signed");
8888

8989
let additional_fee_index = psbt
90-
.outputs
90+
.unsigned_tx
91+
.output
9192
.clone()
9293
.into_iter()
9394
.enumerate()
94-
.find(|(_, output)| {
95+
.find(|(_, txo)| {
9596
invoices.iter().all(|invoice| {
96-
output.redeem_script != Some(invoice.address.script_pubkey())
97-
&& output.witness_script != Some(invoice.address.script_pubkey())
97+
txo.script_pubkey != invoice.address.script_pubkey()
9898
})
9999
})
100100
.map(|(i, _)| i);

0 commit comments

Comments
 (0)