From 53d16e1b38eabee1f1ca304933a818951b8b0f43 Mon Sep 17 00:00:00 2001 From: valued mammal Date: Fri, 24 Jan 2025 09:13:08 -0500 Subject: [PATCH] fix(wallet): use `map_keychain` in `Wallet::build_fee_bump` Previously we failed to remove the change output if the wallet has no internal keychain which caused tx building to fail at the new higher feerate. Fix this by mapping the internal keychain to the de-facto change keychain so that the drain output can be recalculated. --- crates/wallet/src/wallet/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/wallet/src/wallet/mod.rs b/crates/wallet/src/wallet/mod.rs index 70d26c08..3d60aa2e 100644 --- a/crates/wallet/src/wallet/mod.rs +++ b/crates/wallet/src/wallet/mod.rs @@ -1676,7 +1676,7 @@ impl Wallet { if tx.output.len() > 1 { let mut change_index = None; for (index, txout) in tx.output.iter().enumerate() { - let change_keychain = KeychainKind::Internal; + let change_keychain = self.map_keychain(KeychainKind::Internal); match txout_index.index_of_spk(txout.script_pubkey.clone()) { Some((keychain, _)) if *keychain == change_keychain => { change_index = Some(index) -- 2.49.0