mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
Broadcast external IP from NAT in enode record (#10274)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
@ -61,6 +61,14 @@ impl NatResolver {
|
||||
pub async fn external_addr(self) -> Option<IpAddr> {
|
||||
external_addr_with(self).await
|
||||
}
|
||||
|
||||
/// Returns the external ip, if it is [`NatResolver::ExternalIp`]
|
||||
pub const fn as_external_ip(self) -> Option<IpAddr> {
|
||||
match self {
|
||||
Self::ExternalIp(ip) => Some(ip),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for NatResolver {
|
||||
|
||||
Reference in New Issue
Block a user