@@ -213,16 +213,25 @@ where
213213		let  mut  watched_txs = Vec :: with_capacity ( sync_state. watched_transactions . len ( ) ) ; 
214214
215215		for  txid in  & sync_state. watched_transactions  { 
216- 			if  let  Ok ( tx)  = self . client . transaction_get ( & txid)  { 
217- 				watched_txs. push ( ( txid,  tx. clone ( ) ) ) ; 
218- 				if  let  Some ( tx_out)  = tx. output . first ( )  { 
219- 					// We watch an arbitrary output of the transaction of interest in order to 
220- 					// retrieve the associated script history, before narrowing down our search 
221- 					// through `filter`ing by `txid` below. 
222- 					watched_script_pubkeys. push ( tx_out. script_pubkey . clone ( ) ) ; 
223- 				}  else  { 
224- 					debug_assert ! ( false ,  "Failed due to retrieving invalid tx data." ) ; 
225- 					log_error ! ( self . logger,  "Failed due to retrieving invalid tx data." ) ; 
216+ 			match  self . client . transaction_get ( & txid)  { 
217+ 				Ok ( tx)  => { 
218+ 					watched_txs. push ( ( txid,  tx. clone ( ) ) ) ; 
219+ 					if  let  Some ( tx_out)  = tx. output . first ( )  { 
220+ 						// We watch an arbitrary output of the transaction of interest in order to 
221+ 						// retrieve the associated script history, before narrowing down our search 
222+ 						// through `filter`ing by `txid` below. 
223+ 						watched_script_pubkeys. push ( tx_out. script_pubkey . clone ( ) ) ; 
224+ 					}  else  { 
225+ 						debug_assert ! ( false ,  "Failed due to retrieving invalid tx data." ) ; 
226+ 						log_error ! ( self . logger,  "Failed due to retrieving invalid tx data." ) ; 
227+ 						return  Err ( InternalError :: Failed ) ; 
228+ 					} 
229+ 				} 
230+ 				Err ( electrum_client:: Error :: Protocol ( _) )  => { 
231+ 					// We couldn't find the tx, do nothing. 
232+ 				} 
233+ 				Err ( e)  => { 
234+ 					log_error ! ( self . logger,  "Failed to look up transaction {}: {}." ,  txid,  e) ; 
226235					return  Err ( InternalError :: Failed ) ; 
227236				} 
228237			} 
0 commit comments