[NOD-89] Remove BTC seeders from seeder list in all nets and remove D… (#240)

* [NOD-89] Remove BTC seeders from seeder list in all nets and remove DNSSeed type

* [NOD-89] Unremove daglabs dns seed
This commit is contained in:
Ori Newman 2019-04-03 12:45:49 +03:00 committed by Evgeny Khirin
parent 254eab96cd
commit ba03d512f3
3 changed files with 9 additions and 48 deletions

View File

@ -43,10 +43,10 @@ func SeedFromDNS(dagParams *dagconfig.Params, reqServices wire.ServiceFlag, subn
for _, dnsseed := range dagParams.DNSSeeds {
var host string
if !dnsseed.HasFiltering || reqServices == wire.SFNodeNetwork {
host = dnsseed.Host
if reqServices == wire.SFNodeNetwork {
host = dnsseed
} else {
host = fmt.Sprintf("%c%x.%s", ServiceFlagPrefixChar, uint64(reqServices), dnsseed.Host)
host = fmt.Sprintf("%c%x.%s", ServiceFlagPrefixChar, uint64(reqServices), dnsseed)
}
if !subnetworkID.IsEqual(subnetworkid.SubnetworkIDSupportsAll) {

View File

@ -61,16 +61,6 @@ type Checkpoint struct {
Hash *daghash.Hash
}
// DNSSeed identifies a DNS seed.
type DNSSeed struct {
// Host defines the hostname of the seed.
Host string
// HasFiltering defines whether the seed supports filtering
// by service flags (wire.ServiceFlag).
HasFiltering bool
}
// ConsensusDeployment defines details related to a specific consensus rule
// change that is voted in. This is part of BIP0009.
type ConsensusDeployment struct {
@ -122,7 +112,7 @@ type Params struct {
// DNSSeeds defines a list of DNS seeds for the network that are used
// as one method to discover peers.
DNSSeeds []DNSSeed
DNSSeeds []string
// GenesisBlock defines the first block of the chain.
GenesisBlock *wire.MsgBlock
@ -224,14 +214,7 @@ var MainNetParams = Params{
Net: wire.MainNet,
RPCPort: "8334",
DefaultPort: "8333",
DNSSeeds: []DNSSeed{
{"seed.bitcoin.sipa.be", true},
{"dnsseed.bluematt.me", true},
{"dnsseed.bitcoin.dashjr.org", false},
{"seed.bitcoinstats.com", true},
{"seed.bitnodes.io", false},
{"seed.bitcoin.jonasschnelli.ch", true},
},
DNSSeeds: []string{},
// DAG parameters
GenesisBlock: &genesisBlock,
@ -294,7 +277,7 @@ var RegressionNetParams = Params{
Net: wire.TestNet,
RPCPort: "18334",
DefaultPort: "18444",
DNSSeeds: []DNSSeed{},
DNSSeeds: []string{},
// Chain parameters
GenesisBlock: &regTestGenesisBlock,
@ -357,12 +340,7 @@ var TestNet3Params = Params{
Net: wire.TestNet3,
RPCPort: "18334",
DefaultPort: "18333",
DNSSeeds: []DNSSeed{
{"testnet-seed.alexykot.me", false},
{"testnet-seed.bitcoin.petertodd.org", false},
{"testnet-seed.bluematt.me", false},
{"testnet-seed.bitcoin.schildbach.de", false},
},
DNSSeeds: []string{},
// Chain parameters
GenesisBlock: &testNet3GenesisBlock,
@ -429,7 +407,7 @@ var SimNetParams = Params{
Net: wire.SimNet,
RPCPort: "18556",
DefaultPort: "18555",
DNSSeeds: []DNSSeed{}, // NOTE: There must NOT be any seeds.
DNSSeeds: []string{}, // NOTE: There must NOT be any seeds.
// Chain parameters
GenesisBlock: &simNetGenesisBlock,
@ -488,9 +466,7 @@ var DevNetParams = Params{
Net: wire.DevNet,
RPCPort: "18334",
DefaultPort: "18333",
DNSSeeds: []DNSSeed{
{"devnet-dnsseed.daglabs.com", true},
},
DNSSeeds: []string{"devnet-dnsseed.daglabs.com"},
// Chain parameters
GenesisBlock: &devNetGenesisBlock,
@ -555,11 +531,6 @@ var (
registeredNets = make(map[wire.BitcoinNet]struct{})
)
// String returns the hostname of the DNS seed in human-readable form.
func (d DNSSeed) String() string {
return d.Host
}
// Register registers the network parameters for a Bitcoin network. This may
// error with ErrDuplicateNet if the network is already registered (either
// due to a previous Register call, or the network being one of the default

View File

@ -57,13 +57,3 @@ func TestMustRegisterPanic(t *testing.T) {
// Intentionally try to register duplicate params to force a panic.
mustRegister(&MainNetParams)
}
func TestDNSSeedToString(t *testing.T) {
host := "test.dns.seed.com"
seed := DNSSeed{HasFiltering: false, Host: host}
result := seed.String()
if result != host {
t.Errorf("TestDNSSeedToString: Expected: %s, but got: %s", host, result)
}
}