p2p/discovery: fix issues raised in the nodeDb PR
This commit is contained in:
@ -62,13 +62,12 @@ type bucket struct {
|
||||
}
|
||||
|
||||
func newTable(t transport, ourID NodeID, ourAddr *net.UDPAddr, nodeDBPath string) *Table {
|
||||
// If no seed cache was given, use an in-memory one
|
||||
// If no node database was given, use an in-memory one
|
||||
db, err := newNodeDB(nodeDBPath)
|
||||
if err != nil {
|
||||
glog.V(logger.Warn).Infoln("Failed to open node database:", err)
|
||||
db, _ = newNodeDB("")
|
||||
}
|
||||
// Create the bootstrap table
|
||||
tab := &Table{
|
||||
net: t,
|
||||
db: db,
|
||||
@ -90,7 +89,7 @@ func (tab *Table) Self() *Node {
|
||||
return tab.self
|
||||
}
|
||||
|
||||
// Close terminates the network listener and flushes the seed cache.
|
||||
// Close terminates the network listener and flushes the node database.
|
||||
func (tab *Table) Close() {
|
||||
tab.net.close()
|
||||
tab.db.close()
|
||||
|
Reference in New Issue
Block a user