fn compare_enr(local_enr: &Enr, disk_enr: &Enr) -> bool {
    // take preference over disk_enr address if one is not specified
    (local_enr.ip().is_none() || local_enr.ip() == disk_enr.ip())
        // tcp ports must match
        && local_enr.tcp() == disk_enr.tcp()
        // must match on the same fork
        && local_enr.get(ETH2_ENR_KEY) == disk_enr.get(ETH2_ENR_KEY)
        // take preference over disk udp port if one is not specified
        && (local_enr.udp().is_none() || local_enr.udp() == disk_enr.udp())
        // we need the BITFIELD_ENR_KEY key to match, otherwise we use a new ENR. This will likely only
        // be true for non-validating nodes
        && local_enr.get(BITFIELD_ENR_KEY) == disk_enr.get(BITFIELD_ENR_KEY)
}
/// Defines the conditions under which we use the locally built ENR or the one stored on disk.
/// If this function returns true, we use the `disk_enr`.
Defines the conditions under which we use the locally built ENR or the one stored on disk.
If this function returns true, we use the `disk_enr`.
Defines the conditions under which we use the locally built ENR or the one stored on disk . If this function returns true we use the ` disk_enr ` .
fn compare_enr(local_enr: &Enr, disk_enr: &Enr) -> bool {
    // take preference over disk_enr address if one is not specified
    (local_enr.ip().is_none() || local_enr.ip() == disk_enr.ip())
        // tcp ports must match
        && local_enr.tcp() == disk_enr.tcp()
        // must match on the same fork
        && local_enr.get(ETH2_ENR_KEY) == disk_enr.get(ETH2_ENR_KEY)
        // take preference over disk udp port if one is not specified
        && (local_enr.udp().is_none() || local_enr.udp() == disk_enr.udp())
        // we need the BITFIELD_ENR_KEY key to match, otherwise we use a new ENR. This will likely only
        // be true for non-validating nodes
        && local_enr.get(BITFIELD_ENR_KEY) == disk_enr.get(BITFIELD_ENR_KEY)
}
fn compare_enr ( local_enr : & Enr , disk_enr : & Enr ) -> bool { // take preference over disk_enr address if one is not specified ( local_enr . ip ( ) . is_none ( ) || local_enr . ip ( ) == disk_enr . ip ( ) ) // tcp ports must match && local_enr . tcp ( ) == disk_enr . tcp ( ) // must match on the same fork && local_enr . get ( ETH2_ENR_KEY ) == disk_enr . get ( ETH2_ENR_KEY ) // take preference over disk udp port if one is not specified && ( local_enr . udp ( ) . is_none ( ) || local_enr . udp ( ) == disk_enr . udp ( ) ) // we need the BITFIELD_ENR_KEY key to match, otherwise we use a new ENR. This will likely only // be true for non-validating nodes && local_enr . get ( BITFIELD_ENR_KEY ) == disk_enr . get ( BITFIELD_ENR_KEY ) }
Defines the conditions under which we use the locally built ENR or the one stored on disk.
Defines the conditions under which we use the locally built ENR or the one stored on disk .
local_enr
&Enr
disk_enr
&Enr