aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/discover/table.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2015-11-06 05:57:57 +0800
committerPéter Szilágyi <peterke@gmail.com>2015-11-27 17:06:12 +0800
commit9e1d9bff3b18cfa09ba96cd027fa653daae10816 (patch)
tree95d74007caa613ba0c6a62962efcda2e96b273af /p2p/discover/table.go
parent168d0e9e45939b7282204f3f52fe86fc8110cfc7 (diff)
downloaddexon-9e1d9bff3b18cfa09ba96cd027fa653daae10816.tar
dexon-9e1d9bff3b18cfa09ba96cd027fa653daae10816.tar.gz
dexon-9e1d9bff3b18cfa09ba96cd027fa653daae10816.tar.bz2
dexon-9e1d9bff3b18cfa09ba96cd027fa653daae10816.tar.lz
dexon-9e1d9bff3b18cfa09ba96cd027fa653daae10816.tar.xz
dexon-9e1d9bff3b18cfa09ba96cd027fa653daae10816.tar.zst
dexon-9e1d9bff3b18cfa09ba96cd027fa653daae10816.zip
node: customizable protocol and service stacks
Diffstat (limited to 'p2p/discover/table.go')
-rw-r--r--p2p/discover/table.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/p2p/discover/table.go b/p2p/discover/table.go
index c128c2ed1..298ba3fa6 100644
--- a/p2p/discover/table.go
+++ b/p2p/discover/table.go
@@ -90,12 +90,11 @@ type transport interface {
// that was most recently active is the first element in entries.
type bucket struct{ entries []*Node }
-func newTable(t transport, ourID NodeID, ourAddr *net.UDPAddr, nodeDBPath string) *Table {
+func newTable(t transport, ourID NodeID, ourAddr *net.UDPAddr, nodeDBPath string) (*Table, error) {
// If no node database was given, use an in-memory one
db, err := newNodeDB(nodeDBPath, Version, ourID)
if err != nil {
- glog.V(logger.Warn).Infoln("Failed to open node database:", err)
- db, _ = newNodeDB("", Version, ourID)
+ return nil, err
}
tab := &Table{
net: t,
@@ -114,7 +113,7 @@ func newTable(t transport, ourID NodeID, ourAddr *net.UDPAddr, nodeDBPath string
tab.buckets[i] = new(bucket)
}
go tab.refreshLoop()
- return tab
+ return tab, nil
}
// Self returns the local node.