remove health for now?
This commit is contained in:
parent
268ad3a7c5
commit
63adbc0587
@ -699,40 +699,40 @@ impl Web3Rpc {
|
|||||||
|
|
||||||
if new_total_requests - old_total_requests < 10 {
|
if new_total_requests - old_total_requests < 10 {
|
||||||
// TODO: if this fails too many times, reset the connection
|
// TODO: if this fails too many times, reset the connection
|
||||||
let head_block = conn.head_block.read().clone();
|
// let head_block = conn.head_block.read().clone();
|
||||||
|
|
||||||
if let Some((block_hash, txid)) = head_block.and_then(|x| {
|
// if let Some((block_hash, txid)) = head_block.and_then(|x| {
|
||||||
let block = x.block.clone();
|
// let block = x.block.clone();
|
||||||
|
|
||||||
let block_hash = block.hash?;
|
// let block_hash = block.hash?;
|
||||||
let txid = block.transactions.last().cloned()?;
|
// let txid = block.transactions.last().cloned()?;
|
||||||
|
|
||||||
Some((block_hash, txid))
|
// Some((block_hash, txid))
|
||||||
}) {
|
// }) {
|
||||||
let authorization = authorization.clone();
|
// let authorization = authorization.clone();
|
||||||
let conn = conn.clone();
|
// let conn = conn.clone();
|
||||||
|
|
||||||
let x = async move {
|
// let x = async move {
|
||||||
conn.try_request_handle(&authorization, Some(client)).await
|
// conn.try_request_handle(&authorization, Some(client)).await
|
||||||
}
|
// }
|
||||||
.await;
|
// .await;
|
||||||
|
|
||||||
if let Ok(OpenRequestResult::Handle(x)) = x {
|
// if let Ok(OpenRequestResult::Handle(x)) = x {
|
||||||
if let Ok(Some(x)) = x
|
// if let Ok(Some(x)) = x
|
||||||
.request::<_, Option<Transaction>>(
|
// .request::<_, Option<Transaction>>(
|
||||||
"eth_getTransactionByHash",
|
// "eth_getTransactionByHash",
|
||||||
&txid,
|
// &txid,
|
||||||
revert_handler,
|
// revert_handler,
|
||||||
None,
|
// None,
|
||||||
)
|
// )
|
||||||
.await
|
// .await
|
||||||
{
|
// {
|
||||||
// TODO: make this flatter
|
// // TODO: make this flatter
|
||||||
// TODO: do more (fair, not random) things here
|
// // TODO: do more (fair, not random) things here
|
||||||
// let = x.request("eth_getCode", (tx.to.unwrap_or(Address::zero()), block_hash), RequestRevertHandler::ErrorLevel, Some(client.clone()))
|
// // let = x.request("eth_getCode", (tx.to.unwrap_or(Address::zero()), block_hash), RequestRevertHandler::ErrorLevel, Some(client.clone()))
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
old_total_requests = new_total_requests;
|
old_total_requests = new_total_requests;
|
||||||
|
Loading…
Reference in New Issue
Block a user