cmd, eth, p2p, p2p/discover: init and clean up the seed cache

This commit is contained in:
Péter Szilágyi
2015-04-23 18:47:24 +03:00
parent 936c8e19ff
commit 5f735d6fce
6 changed files with 29 additions and 9 deletions

View File

@ -179,6 +179,7 @@ func New(config *Config) (*Ethereum, error) {
if err != nil {
return nil, err
}
seedDbPath := path.Join(config.DataDir, "seeds")
// Perform database sanity checks
d, _ := blockDb.Get([]byte("ProtocolVersion"))
@ -243,6 +244,7 @@ func New(config *Config) (*Ethereum, error) {
NAT: config.NAT,
NoDial: !config.Dial,
BootstrapNodes: config.parseBootNodes(),
SeedCache: seedDbPath,
}
if len(config.Port) > 0 {
eth.net.ListenAddr = ":" + config.Port