From 55325c9b8bece3c196ea2038daf800928229ccb4 Mon Sep 17 00:00:00 2001 From: jp1ac4 <121959000+jp1ac4@users.noreply.github.com> Date: Thu, 4 Jul 2024 10:35:26 +0100 Subject: [PATCH] gui: fix displayed feerate estimate --- gui/src/daemon/model.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gui/src/daemon/model.rs b/gui/src/daemon/model.rs index 01513b01e..bc1d315bf 100644 --- a/gui/src/daemon/model.rs +++ b/gui/src/daemon/model.rs @@ -64,7 +64,14 @@ impl SpendTx { secp: &secp256k1::Secp256k1, network: Network, ) -> Self { - let max_vbytes = desc.unsigned_tx_max_vbytes(&psbt.unsigned_tx, false); + // Use primary path if no inputs are using a relative locktime. + let use_primary_path = !psbt + .unsigned_tx + .input + .iter() + .map(|txin| txin.sequence) + .any(|seq| seq.is_relative_lock_time()); + let max_vbytes = desc.unsigned_tx_max_vbytes(&psbt.unsigned_tx, use_primary_path); let change_indexes: Vec = desc .change_indexes(&psbt, secp) .into_iter()