Skip to content

Commit ac91ad4

Browse files
authored
perf: don't derive node_id from signature unless required (#278)
1 parent 60e24b9 commit ac91ad4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/node_info.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ impl NodeContact {
3535
}
3636

3737
pub fn node_id(&self) -> NodeId {
38-
self.public_key.clone().into()
38+
match self.enr {
39+
Some(ref enr) => enr.node_id(),
40+
None => self.public_key.clone().into(),
41+
}
3942
}
4043

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

0 commit comments

Comments
 (0)