aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/discover/table.go
diff options
context:
space:
mode:
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.