aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/discover/table.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2015-08-06 18:27:59 +0800
committerFelix Lange <fjl@twurst.com>2015-08-06 18:27:59 +0800
commitb23b4dbd79b4699abde4b3954c7480e137ffc3be (patch)
tree1beb39cdac5852350613680cb863829e370decdc /p2p/discover/table.go
parentf12e0161ca7ed2bc5034a7b4904e1b5032e41fe7 (diff)
downloadgo-tangerine-b23b4dbd79b4699abde4b3954c7480e137ffc3be.tar.gz
go-tangerine-b23b4dbd79b4699abde4b3954c7480e137ffc3be.tar.zst
go-tangerine-b23b4dbd79b4699abde4b3954c7480e137ffc3be.zip
p2p/discover: close Table during testing
Not closing the table used to be fine, but now the table has a database.
Diffstat (limited to 'p2p/discover/table.go')
-rw-r--r--p2p/discover/table.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/p2p/discover/table.go b/p2p/discover/table.go
index 48c473475..67f7ec46f 100644
--- a/p2p/discover/table.go
+++ b/p2p/discover/table.go
@@ -164,7 +164,9 @@ func randUint(max uint32) uint32 {
// Close terminates the network listener and flushes the node database.
func (tab *Table) Close() {
- tab.net.close()
+ if tab.net != nil {
+ tab.net.close()
+ }
tab.db.close()
}