mirror of
https://github.com/serai-dex/serai.git
synced 2025-01-09 12:29:27 +00:00
Print when ConnectionErrors occur in reserialize_chain
This commit is contained in:
parent
69454fa9bb
commit
ceeb57470f
1 changed files with 16 additions and 4 deletions
|
@ -22,7 +22,10 @@ async fn check_block(rpc: Arc<Rpc<HttpRpc>>, block_i: usize) {
|
||||||
let hash = loop {
|
let hash = loop {
|
||||||
match rpc.get_block_hash(block_i).await {
|
match rpc.get_block_hash(block_i).await {
|
||||||
Ok(hash) => break hash,
|
Ok(hash) => break hash,
|
||||||
Err(RpcError::ConnectionError) => continue,
|
Err(RpcError::ConnectionError) => {
|
||||||
|
println!("get_block_hash ConnectionError");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
Err(e) => panic!("couldn't get block {block_i}'s hash: {e:?}"),
|
Err(e) => panic!("couldn't get block {block_i}'s hash: {e:?}"),
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -35,7 +38,10 @@ async fn check_block(rpc: Arc<Rpc<HttpRpc>>, block_i: usize) {
|
||||||
let res: BlockResponse = loop {
|
let res: BlockResponse = loop {
|
||||||
match rpc.json_rpc_call("get_block", Some(json!({ "hash": hex::encode(hash) }))).await {
|
match rpc.json_rpc_call("get_block", Some(json!({ "hash": hex::encode(hash) }))).await {
|
||||||
Ok(res) => break res,
|
Ok(res) => break res,
|
||||||
Err(RpcError::ConnectionError) => continue,
|
Err(RpcError::ConnectionError) => {
|
||||||
|
println!("get_block ConnectionError");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
Err(e) => panic!("couldn't get block {block_i} via block.hash(): {e:?}"),
|
Err(e) => panic!("couldn't get block {block_i} via block.hash(): {e:?}"),
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -75,7 +81,10 @@ async fn check_block(rpc: Arc<Rpc<HttpRpc>>, block_i: usize) {
|
||||||
.await
|
.await
|
||||||
{
|
{
|
||||||
Ok(txs) => break txs,
|
Ok(txs) => break txs,
|
||||||
Err(RpcError::ConnectionError) => continue,
|
Err(RpcError::ConnectionError) => {
|
||||||
|
println!("get_transactions ConnectionError");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
Err(e) => panic!("couldn't call get_transactions: {e:?}"),
|
Err(e) => panic!("couldn't call get_transactions: {e:?}"),
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -166,7 +175,10 @@ async fn check_block(rpc: Arc<Rpc<HttpRpc>>, block_i: usize) {
|
||||||
.await
|
.await
|
||||||
{
|
{
|
||||||
Ok(outs) => break outs,
|
Ok(outs) => break outs,
|
||||||
Err(RpcError::ConnectionError) => continue,
|
Err(RpcError::ConnectionError) => {
|
||||||
|
println!("get_outs ConnectionError");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
Err(e) => panic!("couldn't connect to RPC to get outs: {e:?}"),
|
Err(e) => panic!("couldn't connect to RPC to get outs: {e:?}"),
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue