Skip to content

Commit

Permalink
perf: don't derive node_id from signature unless required (#278)
Browse files Browse the repository at this point in the history
  • Loading branch information
KolbyML authored Feb 12, 2025
1 parent 60e24b9 commit ac91ad4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/node_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ impl NodeContact {
}

pub fn node_id(&self) -> NodeId {
self.public_key.clone().into()
match self.enr {
Some(ref enr) => enr.node_id(),
None => self.public_key.clone().into(),
}
}

pub fn seq_no(&self) -> Option<u64> {
Expand Down

0 comments on commit ac91ad4

Please sign in to comment.