diff --git a/Cargo.toml b/Cargo.toml index c5c0b41..0535fbe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "ghost-eye" authors = ["str3tch "] description = "Application for interacting with Casper/Ghost nodes that are exposing RPC only to the localhost" -version = "0.3.87" +version = "0.3.88" edition = "2021" homepage = "https://git.ghostchain.io/ghostchain" repository = "https://git.ghostchain.io/ghostchain/ghost-eye" diff --git a/src/action.rs b/src/action.rs index ac4c3b0..e69f5bc 100644 --- a/src/action.rs +++ b/src/action.rs @@ -132,7 +132,7 @@ pub enum Action { SetChoosenValidator([u8; 32], u32, u32), SetChoosenGatekeeper(u64), SetSlashingSpansLength(usize, [u8; 32]), - SetStoredRpcEndpoints(Vec), + SetStoredRpcEndpoints(u64, Vec), SetRateLimitDelay(u64, u64), UpdateStoredRpcEndpoints(u64, Vec), diff --git a/src/components/validator/gatekeeper_endpoints_popup.rs b/src/components/validator/gatekeeper_endpoints_popup.rs index 0deb841..d5314db 100644 --- a/src/components/validator/gatekeeper_endpoints_popup.rs +++ b/src/components/validator/gatekeeper_endpoints_popup.rs @@ -53,6 +53,7 @@ impl GatekeeperEndpoints { self.chain_id = chain_id; if let Some(network_tx) = &self.network_tx { let _ = network_tx.send(Action::GetRpcEndpoints(chain_id)); + let _ = network_tx.send(Action::GetGatekeepedNetwork(chain_id)); } } @@ -322,10 +323,14 @@ impl Component for GatekeeperEndpoints { } } Action::SetGatekeepedNetwork(network) => { - self.default_endpoints = network.default_endpoints + if network.chain_id == self.chain_id { + self.default_endpoints = network.default_endpoints; + } } - Action::SetStoredRpcEndpoints(stored_endpoints) => { - self.stored_endpoints = stored_endpoints + Action::SetStoredRpcEndpoints(chain_id, stored_endpoints) => { + if chain_id == self.chain_id { + self.stored_endpoints = stored_endpoints; + } } _ => {} }; diff --git a/src/network/legacy_rpc_calls.rs b/src/network/legacy_rpc_calls.rs index 9c61836..53ffbdf 100644 --- a/src/network/legacy_rpc_calls.rs +++ b/src/network/legacy_rpc_calls.rs @@ -266,7 +266,7 @@ pub async fn get_stored_rpc_endpoints( .ok() .unwrap_or_default(); - action_tx.send(Action::SetStoredRpcEndpoints(stored_rpc_endpoints))?; + action_tx.send(Action::SetStoredRpcEndpoints(chain_id, stored_rpc_endpoints))?; Ok(()) }