mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
p2p: close node DB after closing discovery
This fixes a leveldb crash in tests.
This commit is contained in:
parent
91025b7200
commit
0056c2ef2b
1 changed files with 2 additions and 2 deletions
|
|
@ -371,7 +371,6 @@ func (srv *Server) Stop() {
|
|||
return
|
||||
}
|
||||
srv.running = false
|
||||
srv.nodedb.Close()
|
||||
if srv.listener != nil {
|
||||
// this unblocks listener Accept
|
||||
srv.listener.Close()
|
||||
|
|
@ -605,8 +604,9 @@ type dialer interface {
|
|||
|
||||
func (srv *Server) run(dialstate dialer) {
|
||||
srv.log.Info("Started P2P networking", "self", srv.localnode.Node())
|
||||
|
||||
defer srv.loopWG.Done()
|
||||
defer srv.nodedb.Close()
|
||||
|
||||
var (
|
||||
peers = make(map[enode.ID]*Peer)
|
||||
inboundCount = 0
|
||||
|
|
|
|||
Loading…
Reference in a new issue