mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-01-18 05:13:29 +01:00
node: Update DNS seeds, optimize PeerFinder.start()
to start querying… (#5807)
* node: Update DNS seeds, optimize PeerFinder.start() to start querying dns seeds as early as possible * Add new seeds, disable bad seeds * scalafmt
This commit is contained in:
parent
d29dad4472
commit
812f735110
@ -72,13 +72,14 @@ sealed abstract class MainNet extends BitcoinNetwork {
|
||||
Vector(
|
||||
// "seed.bitcoin.sipa.be", very slow, commenting out for now
|
||||
"dnsseed.bluematt.me",
|
||||
"dnsseed.bitcoin.dashjr.org",
|
||||
"dnsseed.bitcoin.dashjr-list-of-p2p-nodes.us",
|
||||
"seed.bitcoinstats.com",
|
||||
// "seed.btc.petertodd.net", very slow, commenting out for now
|
||||
"seed.bitcoin.jonasschnelli.ch",
|
||||
// "seed.bitcoin.jonasschnelli.ch", seems to be down?
|
||||
"seed.bitcoin.sprovoost.nl",
|
||||
"dnsseed.emzy.de",
|
||||
"seed.bitcoin.wiz.biz"
|
||||
"seed.bitcoin.wiz.biz",
|
||||
"seed.mainnet.achownodes.xyz"
|
||||
)
|
||||
}
|
||||
|
||||
@ -104,10 +105,13 @@ sealed abstract class TestNet3 extends BitcoinNetwork {
|
||||
/** @inheritdoc
|
||||
*/
|
||||
override def dnsSeeds: Seq[String] =
|
||||
Seq("testnet-seed.bitcoin.jonasschnelli.ch",
|
||||
"seed.tbtc.petertodd.org",
|
||||
"seed.testnet.bitcoin.sprovoost.nl",
|
||||
"testnet-seed.bluematt.me")
|
||||
Seq(
|
||||
"testnet-seed.bitcoin.jonasschnelli.ch",
|
||||
"seed.tbtc.petertodd.org",
|
||||
"seed.testnet.bitcoin.sprovoost.nl",
|
||||
"testnet-seed.bluematt.me",
|
||||
"seed.testnet.achownodes.xyz"
|
||||
)
|
||||
/*
|
||||
* @inheritdoc
|
||||
*/
|
||||
|
@ -45,7 +45,7 @@ case class PeerFinder(
|
||||
/** Returns peers by querying each dns seed once. These will be IPv4
|
||||
* addresses.
|
||||
*/
|
||||
private def getPeersFromDnsSeeds: Future[Vector[Peer]] = {
|
||||
private lazy val getPeersFromDnsSeeds: Future[Vector[Peer]] = {
|
||||
val dnsSeeds = nodeAppConfig.network.dnsSeeds
|
||||
val addressesF: Future[Vector[String]] = Future
|
||||
.traverse(dnsSeeds) { seed =>
|
||||
@ -163,12 +163,12 @@ case class PeerFinder(
|
||||
_peersToTry.pushAll(pds, priority = 2)
|
||||
|
||||
val peerDiscoveryF = if (nodeAppConfig.enablePeerDiscovery) {
|
||||
val dnsF = getPeersFromDnsSeeds
|
||||
val startedF = for {
|
||||
(dbNonCfPeerDb, dbCfPeerDb) <- getPeersFromDb
|
||||
dbNonCf = dbNonCfPeerDb.map(_.peer(nodeAppConfig.socks5ProxyParams))
|
||||
dbCf = dbCfPeerDb.map(_.peer(nodeAppConfig.socks5ProxyParams))
|
||||
peersDbs <- getPeersFromDnsSeeds.map(dns =>
|
||||
dns ++ getPeersFromResources ++ dbNonCf)
|
||||
peersDbs <- dnsF.map(dns => dns ++ getPeersFromResources ++ dbNonCf)
|
||||
} yield {
|
||||
val pds = peersDbs.map(p => buildPeerData(p, isPersistent = false))
|
||||
_peersToTry.pushAll(pds)
|
||||
|
Loading…
Reference in New Issue
Block a user