mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-01-10 23:27:56 -05:00
hosts: Skip Arti inbound connections on register_channel()
This commit is contained in:
@@ -480,7 +480,7 @@ impl Channel {
|
||||
session.type_id()
|
||||
}
|
||||
|
||||
fn p2p(&self) -> P2pPtr {
|
||||
pub(in crate::net) fn p2p(&self) -> P2pPtr {
|
||||
self.session().p2p()
|
||||
}
|
||||
|
||||
|
||||
@@ -1098,6 +1098,11 @@ impl Hosts {
|
||||
pub(in crate::net) async fn register_channel(&self, channel: ChannelPtr) {
|
||||
let address = channel.address().clone();
|
||||
|
||||
// This is an attempt to skip any Tor (and similar-behaving) inbound connections
|
||||
if channel.p2p().settings().read().await.inbound_addrs.contains(&address) {
|
||||
return
|
||||
}
|
||||
|
||||
// This will panic if we are already connected to this peer, this peer
|
||||
// is suspended, or this peer is currently being inserted into the hostlist.
|
||||
// None of these scenarios should ever happen.
|
||||
|
||||
Reference in New Issue
Block a user