breez / breez-sdk-liquid

MIT License
18 stars 4 forks source link

`PrepareRefundResponse` misleading: refund tx size and fee accurate only for non-cooperative case #487

Open ok300 opened 3 weeks ago

ok300 commented 3 weeks ago

prepare_refund returns a

pub struct PrepareRefundResponse {
    pub tx_vsize: u32,
    pub tx_fee_sat: u64,
    pub refund_tx_id: Option<String>,
}

However, to build that, we rely on LBtcSwapTx::size and BtcSwapTx::size from the Boltz client, which internally calculate the tx size only for the non-cooperative case.

This means we're now over-estimating the chain swap refund tx size and fees, as most refunds happen cooperatively.