Skip to content

Commit

Permalink
perf: don't derive node_id from signature unless required
Browse files Browse the repository at this point in the history
  • Loading branch information
KolbyML committed Feb 12, 2025
1 parent c3592f2 commit 31de664
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 @@ -27,7 +27,10 @@ pub struct NonContactable {

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 31de664

Please sign in to comment.