* 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>
* reannouce local pending transactions
* add tests for tx_pool reannouce local pending transactions
* add tests for handler reannounce local pending transactions
This commit splits the eth package, separating the handling of eth and snap protocols. It also includes the capability to run snap sync (https://github.com/ethereum/devp2p/blob/master/caps/snap.md) , but does not enable it by default.
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Co-authored-by: Martin Holst Swende <martin@swende.se>