own stash identification fix
Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
This commit is contained in:
parent
6e7104f229
commit
5e90456fdf
@ -34,6 +34,7 @@ pub struct CurrentValidators {
|
|||||||
table_state: TableState,
|
table_state: TableState,
|
||||||
individual: Vec<EraRewardPoints>,
|
individual: Vec<EraRewardPoints>,
|
||||||
known_validators: std::collections::HashMap<[u8; 32], String>,
|
known_validators: std::collections::HashMap<[u8; 32], String>,
|
||||||
|
active_validators: std::collections::HashSet<String>,
|
||||||
total_points: u32,
|
total_points: u32,
|
||||||
era_index: u32,
|
era_index: u32,
|
||||||
my_stash_id: Option<[u8; 32]>,
|
my_stash_id: Option<[u8; 32]>,
|
||||||
@ -57,6 +58,7 @@ impl CurrentValidators {
|
|||||||
table_state: TableState::new(),
|
table_state: TableState::new(),
|
||||||
individual: Default::default(),
|
individual: Default::default(),
|
||||||
known_validators: Default::default(),
|
known_validators: Default::default(),
|
||||||
|
active_validators: Default::default(),
|
||||||
total_points: 0,
|
total_points: 0,
|
||||||
era_index: 0,
|
era_index: 0,
|
||||||
my_stash_id: None,
|
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
|
let name = self.known_validators
|
||||||
.get(&info.account_id)
|
.get(&info.account_id)
|
||||||
.cloned()
|
.cloned()
|
||||||
|
Loading…
Reference in New Issue
Block a user