Skip to content

Commit e7188b9

Browse files
committed
Send Payjoin with fee_rate parameter
1 parent de8d8b3 commit e7188b9

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/bitcoin/payment.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,14 @@ pub async fn create_payjoin(
6464
let original_psbt = sign_original_psbt(wallet, psbt).await?;
6565
info!("Original PSBT successfully signed");
6666

67-
// TODO use fee_rate
68-
let pj_params = payjoin::send::Configuration::non_incentivizing();
67+
let pj_params = match fee_rate {
68+
Some(fee_rate) => {
69+
payjoin::send::Configuration::with_fee_contribution(bitcoin::Amount::ZERO, 0)
70+
.min_fee_rate_sat_per_vb(fee_rate.as_sat_per_vb())
71+
}
72+
None => payjoin::send::Configuration::non_incentivizing(),
73+
};
74+
6975
let (req, ctx) = pj_uri.create_pj_request(original_psbt.clone(), pj_params)?;
7076
info!("Built PayJoin request");
7177
let response = reqwest::Client::new()

0 commit comments

Comments
 (0)