15bc2548c1
* fix logic issue: handlers.removePeer() is called twice. There is a logic issue which cause "Ethereum peer removal failed, err=peer not registered" occur quite often. handler.runEthPeer set up a defer removePeer(). This is always called after a peer is disconnected. However removePeer is also called by mulitple functions like downloader/fetcher. After those kind of functions removePeer(), peer handler executes defer removePeer(). This makes removePeer() happened twice, and this is the reason we often see "Ethereum peer removal failed, err=peer not registered". To solve this, removePeer only needs to hard Disconnect peer from networking layer. Then defer unregisterPeer() will do the cleanup task after then. * fix: modify test function for close testing. reference from go-thereum. Co-authored-by: zjubfd <296179868@qq.com> |
||
---|---|---|
.. | ||
discover | ||
dnsdisc | ||
enode | ||
enr | ||
nat | ||
netutil | ||
nodestate | ||
rlpx | ||
simulations | ||
tracker | ||
dial_test.go | ||
dial.go | ||
message_test.go | ||
message.go | ||
metrics.go | ||
peer_error.go | ||
peer_test.go | ||
peer.go | ||
protocol.go | ||
server_test.go | ||
server.go | ||
transport_test.go | ||
transport.go | ||
util_test.go | ||
util.go |