From 31290b6b3579c89963013d762b8e56889b0d01e6 Mon Sep 17 00:00:00 2001 From: kdeme Date: Thu, 18 Apr 2019 12:25:41 +0200 Subject: [PATCH] Fix to only allow sync for peer with eth support --- eth/p2p/blockchain_sync.nim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/eth/p2p/blockchain_sync.nim b/eth/p2p/blockchain_sync.nim index 706e761..803e3d1 100644 --- a/eth/p2p/blockchain_sync.nim +++ b/eth/p2p/blockchain_sync.nim @@ -331,10 +331,12 @@ proc onPeerDisconnected(ctx: SyncContext, p: Peer) = proc startSync(ctx: SyncContext) = var po: PeerObserver po.onPeerConnected = proc(p: Peer) {.gcsafe.} = - ctx.onPeerConnected(p) + if p.supports(eth): + ctx.onPeerConnected(p) po.onPeerDisconnected = proc(p: Peer) {.gcsafe.} = - ctx.onPeerDisconnected(p) + if p.supports(eth): + ctx.onPeerDisconnected(p) ctx.peerPool.addObserver(ctx, po)