From 5e90456fdff46c1d6c14a0f6af4ee3035672088b Mon Sep 17 00:00:00 2001 From: Uncle Stretch Date: Mon, 17 Feb 2025 17:31:37 +0300 Subject: [PATCH] own stash identification fix Signed-off-by: Uncle Stretch --- src/components/nominator/current_validators.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/components/nominator/current_validators.rs b/src/components/nominator/current_validators.rs index 0664c98..3f04248 100644 --- a/src/components/nominator/current_validators.rs +++ b/src/components/nominator/current_validators.rs @@ -34,6 +34,7 @@ pub struct CurrentValidators { table_state: TableState, individual: Vec, known_validators: std::collections::HashMap<[u8; 32], String>, + active_validators: std::collections::HashSet, total_points: u32, era_index: u32, my_stash_id: Option<[u8; 32]>, @@ -57,6 +58,7 @@ impl CurrentValidators { table_state: TableState::new(), individual: Default::default(), known_validators: Default::default(), + active_validators: Default::default(), total_points: 0, era_index: 0, my_stash_id: None, @@ -268,7 +270,14 @@ impl Component for CurrentValidators { } - if self.my_stash_id.is_some() && index == 0 { + let mut current_validator_is_my_stash = false; + if index == 0 { + if let Some(account_id) = self.my_stash_id { + current_validator_is_my_stash = account_id == info.account_id; + } + }; + + if current_validator_is_my_stash { let name = self.known_validators .get(&info.account_id) .cloned()