This repository was archived by the owner on Jul 27, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ use crate::rpc::sync_rpc::{SyncRpc, SyncRpcImpl};
5
5
use crate :: rpc:: transaction_rpc:: { TransactionRpc , TransactionRpcImpl } ;
6
6
use crate :: rpc:: wallet_rpc:: { WalletRpc , WalletRpcImpl } ;
7
7
use std:: net:: SocketAddr ;
8
+ use std:: thread;
9
+ use std:: time:: Duration ;
8
10
9
11
use chain_core:: init:: network:: { get_network, get_network_id, init_chain_id} ;
10
12
use chain_core:: tx:: fee:: LinearFee ;
@@ -198,7 +200,22 @@ impl Server {
198
200
let mut io = IoHandler :: new ( ) ;
199
201
let storage = SledStorage :: new ( & self . storage_dir ) ?;
200
202
201
- let tendermint_client = WebsocketRpcClient :: new ( & self . websocket_url ) ?;
203
+ let tendermint_client = loop {
204
+ match WebsocketRpcClient :: new ( & self . websocket_url ) {
205
+ Ok ( client) => {
206
+ break Ok ( client) ;
207
+ }
208
+ Err ( error) => {
209
+ if ErrorKind :: InitializationError == error. kind ( ) {
210
+ log:: error!( "{:?}" , error) ;
211
+ } else {
212
+ break Err ( error) ;
213
+ }
214
+ }
215
+ }
216
+
217
+ thread:: sleep ( Duration :: from_secs ( 2 ) ) ;
218
+ } ?;
202
219
203
220
self . start_client ( & mut io, storage. clone ( ) , tendermint_client. clone ( ) )
204
221
. unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments