We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7b7067b commit 683931cCopy full SHA for 683931c
stackslib/src/net/db.rs
@@ -185,6 +185,21 @@ impl LocalPeer {
185
)),
186
}
187
188
+
189
+ /// Best-effort attempt to calculate a publicly-routable neighbor address for local peer
190
+ pub fn to_public_neighbor_addr(&self) -> NeighborAddress {
191
+ if let Some((peer_addr, peer_port)) = self.public_ip_address.as_ref() {
192
+ NeighborAddress {
193
+ addrbytes: peer_addr.clone(),
194
+ port: *peer_port,
195
+ public_key_hash: Hash160::from_node_public_key(&StacksPublicKey::from_private(
196
+ &self.private_key,
197
+ )),
198
+ }
199
+ } else {
200
+ self.to_neighbor_addr()
201
202
203
204
205
impl FromRow<LocalPeer> for LocalPeer {
0 commit comments