null private transactions instead of empty

This commit is contained in:
Bryan Stitt 2022-10-20 07:03:58 +00:00
parent 1da730daa2
commit 848eb61349
2 changed files with 8 additions and 4 deletions

@ -359,10 +359,14 @@ impl Web3ProxyApp {
.await .await
.context("spawning private_rpcs")?; .context("spawning private_rpcs")?;
// save the handle to catch any errors if private_rpcs.conns.len() == 0 {
handles.push(private_handle); None
} else {
// save the handle to catch any errors
handles.push(private_handle);
Some(private_rpcs) Some(private_rpcs)
}
}; };
// create rate limiters // create rate limiters

@ -38,7 +38,7 @@ use tracing::{error, info, instrument, trace, warn};
/// A collection of web3 connections. Sends requests either the current best server or all servers. /// A collection of web3 connections. Sends requests either the current best server or all servers.
#[derive(From)] #[derive(From)]
pub struct Web3Connections { pub struct Web3Connections {
pub(super) conns: HashMap<String, Arc<Web3Connection>>, pub(crate) conns: HashMap<String, Arc<Web3Connection>>,
/// any requests will be forwarded to one (or more) of these connections /// any requests will be forwarded to one (or more) of these connections
pub(super) synced_connections: ArcSwap<SyncedConnections>, pub(super) synced_connections: ArcSwap<SyncedConnections>,
pub(super) pending_transactions: pub(super) pending_transactions: