mirror of https://github.com/status-im/nim-eth.git
Fix to only allow sync for peer with eth support
This commit is contained in:
parent
32bb1f35d7
commit
31290b6b35
|
@ -331,9 +331,11 @@ proc onPeerDisconnected(ctx: SyncContext, p: Peer) =
|
|||
proc startSync(ctx: SyncContext) =
|
||||
var po: PeerObserver
|
||||
po.onPeerConnected = proc(p: Peer) {.gcsafe.} =
|
||||
if p.supports(eth):
|
||||
ctx.onPeerConnected(p)
|
||||
|
||||
po.onPeerDisconnected = proc(p: Peer) {.gcsafe.} =
|
||||
if p.supports(eth):
|
||||
ctx.onPeerDisconnected(p)
|
||||
|
||||
ctx.peerPool.addObserver(ctx, po)
|
||||
|
|
Loading…
Reference in New Issue