aboutsummaryrefslogtreecommitdiffstats
path: root/eth/helper_test.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2016-05-09 20:59:41 +0800
committerPéter Szilágyi <peterke@gmail.com>2016-05-09 20:59:41 +0800
commit756b62988c15afc748c529610f29769a89f86c35 (patch)
tree4828236bb18861a9527f184d33f8df410d37ae19 /eth/helper_test.go
parentdc7f202ecd39db925c2d425fea36084efcda5ecc (diff)
parent56ed6152a11592d20220daf6322e94a009e6236d (diff)
downloadgo-tangerine-756b62988c15afc748c529610f29769a89f86c35.tar
go-tangerine-756b62988c15afc748c529610f29769a89f86c35.tar.gz
go-tangerine-756b62988c15afc748c529610f29769a89f86c35.tar.bz2
go-tangerine-756b62988c15afc748c529610f29769a89f86c35.tar.lz
go-tangerine-756b62988c15afc748c529610f29769a89f86c35.tar.xz
go-tangerine-756b62988c15afc748c529610f29769a89f86c35.tar.zst
go-tangerine-756b62988c15afc748c529610f29769a89f86c35.zip
Merge pull request #2523 from fjl/shutdown
core, eth, miner: improve shutdown synchronisation
Diffstat (limited to 'eth/helper_test.go')
-rw-r--r--eth/helper_test.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/eth/helper_test.go b/eth/helper_test.go
index 5703d44cc..dacb1593f 100644
--- a/eth/helper_test.go
+++ b/eth/helper_test.go
@@ -140,14 +140,14 @@ func newTestPeer(name string, version int, pm *ProtocolManager, shake bool) (*te
// Start the peer on a new thread
errc := make(chan error, 1)
go func() {
- pm.newPeerCh <- peer
- errc <- pm.handle(peer)
+ select {
+ case pm.newPeerCh <- peer:
+ errc <- pm.handle(peer)
+ case <-pm.quitSync:
+ errc <- p2p.DiscQuitting
+ }
}()
- tp := &testPeer{
- app: app,
- net: net,
- peer: peer,
- }
+ tp := &testPeer{app: app, net: net, peer: peer}
// Execute any implicitly requested handshakes and return
if shake {
td, head, genesis := pm.blockchain.Status()