@@ -637,11 +637,11 @@ impl ElectrumRuntimeClient {
637637 let electrum_client = Arc :: clone ( & self . electrum_client ) ;
638638
639639 let txid = tx. compute_txid ( ) ;
640- let tx = Arc :: new ( [ tx ] ) ;
640+ let tx = Arc :: new ( tx ) ;
641641
642642 let spawn_fut = self . runtime . spawn_blocking ( {
643643 let tx = Arc :: clone ( & tx) ;
644- move || electrum_client. transaction_broadcast ( tx. first ( ) . expect ( "The length is 1" ) )
644+ move || electrum_client. transaction_broadcast ( tx. as_ref ( ) )
645645 } ) ;
646646 let timeout_fut = tokio:: time:: timeout (
647647 Duration :: from_secs ( self . sync_config . timeouts_config . tx_broadcast_timeout_secs ) ,
@@ -653,10 +653,12 @@ impl ElectrumRuntimeClient {
653653 Ok ( Ok ( txid) ) => {
654654 log_trace ! ( self . logger, "Successfully broadcast transaction {}" , txid) ;
655655 } ,
656- Ok ( Err ( e) ) => self . log_broadcast_error ( e, & [ txid] , tx. as_ref ( ) ) ,
657- Err ( e) => self . log_broadcast_error ( e, & [ txid] , tx. as_ref ( ) ) ,
656+ Ok ( Err ( e) ) => {
657+ self . log_broadcast_error ( e, & [ txid] , core:: slice:: from_ref ( tx. as_ref ( ) ) )
658+ } ,
659+ Err ( e) => self . log_broadcast_error ( e, & [ txid] , core:: slice:: from_ref ( tx. as_ref ( ) ) ) ,
658660 } ,
659- Err ( e) => self . log_broadcast_error ( e, & [ txid] , tx. as_ref ( ) ) ,
661+ Err ( e) => self . log_broadcast_error ( e, & [ txid] , core :: slice :: from_ref ( tx. as_ref ( ) ) ) ,
660662 }
661663 }
662664
0 commit comments