Skip to content

Commit

Permalink
Backport of #343 #344 (#352)
Browse files Browse the repository at this point in the history
* chore: add new utreexo seed [seed.bitcoin.luisschwab.com] (#343)

* fix,log: remove unresponsive peers, better DNS logging (#344)

* fix: remove unresponsive DNS seeds

Removes unresponsive DNS seeds `seed.bitcoin.jonasschnelli.ch` and `dnsseed.bitcoin.dashjr.org`

* log: better logging for DNS peer discovery

---------

Co-authored-by: Luis Schwab <97608688+luisschwab@users.noreply.github.com>
  • Loading branch information
Davidson-Souza and luisschwab authored Jan 25, 2025
1 parent 6615959 commit d23924b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
15 changes: 5 additions & 10 deletions crates/floresta-chain/src/pruned_utreexo/chainparams.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,21 +277,16 @@ pub fn get_chain_dns_seeds(network: Network) -> Vec<DnsSeed> {
Network::Bitcoin => {
seeds.push(DnsSeed::new(
Network::Bitcoin,
"seed.bitcoin.sipa.be",
x9, // no COMPACT_FILTERS
"seed.bitcoin.luisschwab.com",
x1000049,
));
seeds.push(DnsSeed::new(Network::Bitcoin, "dnsseed.bluematt.me", x49));
seeds.push(DnsSeed::new(
Network::Bitcoin,
"dnsseed.bitcoin.dashjr.org",
none, // no filter
"seed.bitcoin.sipa.be",
x9, // no COMPACT_FILTERS
));
seeds.push(DnsSeed::new(Network::Bitcoin, "dnsseed.bluematt.me", x49));
seeds.push(DnsSeed::new(Network::Bitcoin, "seed.bitcoinstats.com", x49));
seeds.push(DnsSeed::new(
Network::Bitcoin,
"seed.bitcoin.jonasschnelli.ch",
x49,
));
seeds.push(DnsSeed::new(
Network::Bitcoin,
"seed.btc.petertodd.org",
Expand Down
13 changes: 10 additions & 3 deletions crates/floresta-wire/src/p2p_wire/address_man.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,16 +449,23 @@ impl AddressMan {
self.push_addresses(&persisted_peers);

let mut peers_from_dns = 0;
info!("Starting peer discovery via DNS seeds");
for seed in dns_seeds {
match self.get_seeds_from_dns(seed, default_port) {
Ok(peers) => peers_from_dns += peers,
Ok(peers) => {
peers_from_dns += peers;
info!("Got {} peers from {}", peers, seed.seed);
}
Err(e) => {
info!("Error getting peers from DNS seed {}: {e:?}", seed.seed);
}
}
}

info!("Got {peers_from_dns} peers from DNS Seeds",);
info!(
"Got {} peers from {} DNS seeds",
peers_from_dns,
dns_seeds.len()
);

let anchors = std::fs::read_to_string(format!("{datadir}/anchors.json"))?;
let anchors = serde_json::from_str::<Vec<DiskLocalAddress>>(&anchors)?;
Expand Down

0 comments on commit d23924b

Please sign in to comment.