Skip to content

Commit

Permalink
fix(dashboard): Correctly show nodes as decentralized even if they ar…
Browse files Browse the repository at this point in the history
…e not in FactsDB
  • Loading branch information
sasa-tomic committed May 11, 2023
1 parent fc25887 commit b83be5a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions rs/ic-management-backend/src/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,12 +367,13 @@ impl RegistryState {
.map(|(_, o)| o.clone())
.expect("missing operator referenced by a node");
let principal = PrincipalId::from_str(p).expect("invalid node principal id");
let ip_addr = node_ip_addr(nr);
(
principal,
Node {
principal,
dfinity_owned: Some(guest.as_ref().map(|g| g.dfinity_owned).unwrap_or_default()),
ip_addr: node_ip_addr(nr),
ip_addr,
hostname: guest
.as_ref()
.map(|g| g.name.clone())
Expand All @@ -398,8 +399,8 @@ impl RegistryState {
.map(|s| s.get()),
operator,
proposal: None,
label: guest.clone().map(|g| g.name),
decentralized: guest.map(|g| g.decentralized).unwrap_or_default(),
label: guest.map(|g| g.name),
decentralized: ip_addr.segments()[4] == 0x6801,
duplicates: node_entries
.iter()
.filter(|(_, (_, nr2))| node_ip_addr(nr2) == node_ip_addr(nr))
Expand Down

0 comments on commit b83be5a

Please sign in to comment.