File tree 1 file changed +15
-17
lines changed
1 file changed +15
-17
lines changed Original file line number Diff line number Diff line change @@ -346,24 +346,22 @@ impl<E: ElectrumApi> BdkElectrumClient<E> {
346
346
Err ( other_err) => return Err ( other_err) ,
347
347
} ;
348
348
349
- let spk = tx
350
- . output
351
- . first ( )
352
- . map ( |txo| & txo. script_pubkey )
353
- . expect ( "tx must have an output" ) ;
354
-
355
- // because of restrictions of the Electrum API, we have to use the `script_get_history`
356
- // call to get confirmation status of our transaction
357
- if let Some ( r) = self
358
- . inner
359
- . script_get_history ( spk) ?
360
- . into_iter ( )
361
- . find ( |r| r. tx_hash == txid)
362
- {
363
- self . validate_merkle_for_anchor ( tx_update, txid, r. height ) ?;
364
- }
349
+ if let Some ( txo) = tx. output . first ( ) {
350
+ let spk = & txo. script_pubkey ;
351
+
352
+ // because of restrictions of the Electrum API, we have to use the `script_get_history`
353
+ // call to get confirmation status of our transaction
354
+ if let Some ( r) = self
355
+ . inner
356
+ . script_get_history ( spk) ?
357
+ . into_iter ( )
358
+ . find ( |r| r. tx_hash == txid)
359
+ {
360
+ self . validate_merkle_for_anchor ( tx_update, txid, r. height ) ?;
361
+ }
365
362
366
- tx_update. txs . push ( tx) ;
363
+ tx_update. txs . push ( tx) ;
364
+ }
367
365
}
368
366
Ok ( ( ) )
369
367
}
You can’t perform that action at this time.
0 commit comments