Announcing port on DHT

This commit is contained in:
Igor Katson 2023-12-05 21:17:37 +00:00
parent 162afe3056
commit 6bb5d01c0f
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5
3 changed files with 19 additions and 62 deletions

View file

@ -20,7 +20,7 @@ use crate::{Dht, DhtConfig, DhtState};
pub struct PersistentDhtConfig {
pub dump_interval: Option<Duration>,
pub config_filename: Option<PathBuf>,
pub announce_addr: Option<SocketAddr>,
pub announce_port: Option<u16>,
}
#[derive(Serialize, Deserialize)]
@ -118,7 +118,7 @@ impl PersistentDht {
routing_table,
listen_addr,
peer_store,
announce_addr: config.announce_addr,
announce_port: config.announce_port,
..Default::default()
};
let dht = DhtState::with_config(dht_config).await?;