File tree Expand file tree Collapse file tree 3 files changed +13
-4
lines changed
Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -225,14 +225,21 @@ pub async fn subscribe_to_new_heads(
225225 }
226226 Ok ( None ) => {
227227 // Handle the case where the channel is closed
228+ log_err ! ( "newHeads channel closed." ) ;
228229 panic ! ( "FATAL: Channel closed in newHeads subscription." ) ;
229230 }
230231 Err ( _) => {
231232 // Handle the timeout case
232233 {
233234 let mut nn_rwlock = cache_args. named_numbers . write ( ) . unwrap ( ) ;
234235 nn_rwlock. latest = 0 ;
235- incoming_tx. send ( WsconnMessage :: Reconnect ( ) ) . unwrap ( ) ;
236+ match incoming_tx. send ( WsconnMessage :: Reconnect ( ) ) {
237+ Ok ( _) => { } ,
238+ Err ( _) => {
239+ log_err ! ( "WS incoming channel closed." ) ;
240+ panic ! ( "FATAL: WS module failed trying to reinitialize! Please restart Blutgang!" ) ;
241+ } ,
242+ }
236243 }
237244 log_wrn ! ( "Timeout in newHeads subscription, possible connection failiure or missed block." ) ;
238245 let node_id = match sub_data. get_node_from_id ( & subscription_id) {
Original file line number Diff line number Diff line change @@ -160,7 +160,7 @@ impl Rpc {
160160 } ) ;
161161
162162 let number: Value =
163- unsafe { simd_json:: serde:: from_str ( & mut self . send_request ( request) . await ?) . unwrap ( ) } ;
163+ unsafe { simd_json:: serde:: from_str ( & mut self . send_request ( request) . await ?) ? } ;
164164 let number = & number[ "result" ] [ "number" ] ;
165165
166166 let number = match number. as_str ( ) {
Original file line number Diff line number Diff line change @@ -197,8 +197,10 @@ pub async fn ws_conn(
197197 let rax = match unsafe { from_str ( & mut ws_message) } {
198198 Ok ( rax) => rax,
199199 Err ( _e) => {
200- #[ cfg( feature = "debug-verbose" ) ]
201- log_wrn ! ( "Couldn't deserialize ws_conn response: {}" , _e) ;
200+ #[ cfg( feature = "debug-verbose" ) ] {
201+ use crate :: log_wrn;
202+ log_wrn ! ( "Couldn't deserialize ws_conn response: {}" , _e) ;
203+ }
202204
203205 continue ;
204206 }
You can’t perform that action at this time.
0 commit comments