aboutsummaryrefslogtreecommitdiffstats
path: root/eth/backend.go
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2015-04-28 18:40:10 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2015-04-28 18:40:10 +0800
commit91cb8cdd2acdcaceb577fd0ea9eb0997d42f8470 (patch)
tree35f36ea4a2cbc68a5b0410e4367d485db3ffe545 /eth/backend.go
parente88b410b4d25c65b023b4ee7b4d1bc5dbc4dab93 (diff)
parent4992765032b4318f3f5b4940a553b4e552c55963 (diff)
downloaddexon-91cb8cdd2acdcaceb577fd0ea9eb0997d42f8470.tar.gz
dexon-91cb8cdd2acdcaceb577fd0ea9eb0997d42f8470.tar.zst
dexon-91cb8cdd2acdcaceb577fd0ea9eb0997d42f8470.zip
Merge pull request #793 from karalabe/discovery-node-cache
p2p/discover: persistent node database
Diffstat (limited to 'eth/backend.go')
-rw-r--r--eth/backend.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/eth/backend.go b/eth/backend.go
index 466912899..c5fa328b0 100644
--- a/eth/backend.go
+++ b/eth/backend.go
@@ -125,6 +125,7 @@ type Ethereum struct {
blockDb common.Database // Block chain database
stateDb common.Database // State changes database
extraDb common.Database // Extra database (txs, etc)
+
// Closed when databases are flushed and closed
databasesClosed chan bool
@@ -179,6 +180,7 @@ func New(config *Config) (*Ethereum, error) {
if err != nil {
return nil, err
}
+ nodeDb := path.Join(config.DataDir, "nodes")
// Perform database sanity checks
d, _ := blockDb.Get([]byte("ProtocolVersion"))
@@ -245,6 +247,7 @@ func New(config *Config) (*Ethereum, error) {
NAT: config.NAT,
NoDial: !config.Dial,
BootstrapNodes: config.parseBootNodes(),
+ NodeDatabase: nodeDb,
}
if len(config.Port) > 0 {
eth.net.ListenAddr = ":" + config.Port