]> Untitled Git - bdk-cli/commitdiff
Restrict payjoin inputs to confirmed UTXOs
authorMshehu5 <musheu@gmail.com>
Sat, 6 Jun 2026 11:24:36 +0000 (12:24 +0100)
committerMshehu5 <musheu@gmail.com>
Thu, 2 Jul 2026 11:30:30 +0000 (12:30 +0100)
Prevent wallet failures caused by selecting unconfirmed coins for
payjoin inputs.

Without this filter, the wallet can fail with an "unconfirmed
coins" error during payjoin processing.

src/payjoin/mod.rs

index 20410b381649a62bed8ce91a9db304efd507d1cd..e811213e5814625d02030dc4470657f8101a9b8f 100644 (file)
@@ -548,6 +548,7 @@ impl<'a> PayjoinManager<'a> {
         let candidate_inputs: Vec<InputPair> = self
             .wallet
             .list_unspent()
+            .filter(|output| output.chain_position.is_confirmed())
             .map(|output| {
                 let psbtin = self
                     .wallet