@@ -288,6 +288,34 @@ impl InvoiceResponse {
288288 }
289289
290290 log:: info!( "transaction.mempool/confirmed Boltz broadcasted funding tx" ) ;
291+
292+ // Parse the lockup transaction from the status update if available.
293+ // This avoids waiting for the transaction to propagate to the chain client's mempool,
294+ // significantly improving claim speed.
295+ let lockup_tx = if let Some ( tx_info) = & update. transaction {
296+ match self . swap_script . parse_lockup_transaction ( tx_info) . await {
297+ Ok ( tx) => {
298+ log:: debug!( "Parsed lockup tx from status update" ) ;
299+ Some ( tx)
300+ }
301+ Err ( e) => {
302+ log:: warn!( "Failed to parse lockup tx from status update: {e}, will fetch from chain client" ) ;
303+ None
304+ }
305+ }
306+ } else {
307+ log:: debug!( "No transaction info in status update, will fetch from chain client" ) ;
308+ None
309+ } ;
310+
311+ // Build options with lockup_tx if available for faster claiming
312+ let options = match lockup_tx {
313+ Some ( tx) => TransactionOptions :: default ( )
314+ . with_cooperative ( true )
315+ . with_lockup_tx ( tx) ,
316+ None => TransactionOptions :: default ( ) . with_cooperative ( true ) ,
317+ } ;
318+
291319 let tx = self
292320 . swap_script
293321 . construct_claim (
@@ -297,7 +325,7 @@ impl InvoiceResponse {
297325 output_address : self . data . claim_address . to_string ( ) ,
298326 fee : Fee :: Relative ( 0.12 ) , // TODO make it configurable
299327 swap_id : self . swap_id ( ) . to_string ( ) ,
300- options : Some ( TransactionOptions :: default ( ) . with_cooperative ( true ) ) ,
328+ options : Some ( options ) ,
301329 chain_client : & self . chain_client ,
302330 boltz_client : & self . api ,
303331 } ,
0 commit comments