diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-04-28 18:40:10 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-04-28 18:40:10 +0800 |
commit | 91cb8cdd2acdcaceb577fd0ea9eb0997d42f8470 (patch) | |
tree | 35f36ea4a2cbc68a5b0410e4367d485db3ffe545 /eth/backend.go | |
parent | e88b410b4d25c65b023b4ee7b4d1bc5dbc4dab93 (diff) | |
parent | 4992765032b4318f3f5b4940a553b4e552c55963 (diff) | |
download | go-tangerine-91cb8cdd2acdcaceb577fd0ea9eb0997d42f8470.tar go-tangerine-91cb8cdd2acdcaceb577fd0ea9eb0997d42f8470.tar.gz go-tangerine-91cb8cdd2acdcaceb577fd0ea9eb0997d42f8470.tar.bz2 go-tangerine-91cb8cdd2acdcaceb577fd0ea9eb0997d42f8470.tar.lz go-tangerine-91cb8cdd2acdcaceb577fd0ea9eb0997d42f8470.tar.xz go-tangerine-91cb8cdd2acdcaceb577fd0ea9eb0997d42f8470.tar.zst go-tangerine-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.go | 3 |
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 |