File tree Expand file tree Collapse file tree 1 file changed +15
-17
lines changed
Expand file tree Collapse file tree 1 file changed +15
-17
lines changed Original file line number Diff line number Diff line change @@ -360,24 +360,22 @@ impl<E: ElectrumApi> BdkElectrumClient<E> {
360360 Err ( other_err) => return Err ( other_err) ,
361361 } ;
362362
363- let spk = tx
364- . output
365- . first ( )
366- . map ( |txo| & txo. script_pubkey )
367- . expect ( "tx must have an output" ) ;
368-
369- // because of restrictions of the Electrum API, we have to use the `script_get_history`
370- // call to get confirmation status of our transaction
371- if let Some ( r) = self
372- . inner
373- . script_get_history ( spk) ?
374- . into_iter ( )
375- . find ( |r| r. tx_hash == txid)
376- {
377- self . validate_merkle_for_anchor ( tx_update, txid, r. height ) ?;
378- }
363+ if let Some ( txo) = tx. output . first ( ) {
364+ let spk = & txo. script_pubkey ;
365+
366+ // because of restrictions of the Electrum API, we have to use the `script_get_history`
367+ // call to get confirmation status of our transaction
368+ if let Some ( r) = self
369+ . inner
370+ . script_get_history ( spk) ?
371+ . into_iter ( )
372+ . find ( |r| r. tx_hash == txid)
373+ {
374+ self . validate_merkle_for_anchor ( tx_update, txid, r. height ) ?;
375+ }
379376
380- tx_update. txs . push ( tx) ;
377+ tx_update. txs . push ( tx) ;
378+ }
381379 }
382380 Ok ( ( ) )
383381 }
You can’t perform that action at this time.
0 commit comments