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,10 +331,12 @@ proc onPeerDisconnected(ctx: SyncContext, p: Peer) =
|
||||||
proc startSync(ctx: SyncContext) =
|
proc startSync(ctx: SyncContext) =
|
||||||
var po: PeerObserver
|
var po: PeerObserver
|
||||||
po.onPeerConnected = proc(p: Peer) {.gcsafe.} =
|
po.onPeerConnected = proc(p: Peer) {.gcsafe.} =
|
||||||
ctx.onPeerConnected(p)
|
if p.supports(eth):
|
||||||
|
ctx.onPeerConnected(p)
|
||||||
|
|
||||||
po.onPeerDisconnected = proc(p: Peer) {.gcsafe.} =
|
po.onPeerDisconnected = proc(p: Peer) {.gcsafe.} =
|
||||||
ctx.onPeerDisconnected(p)
|
if p.supports(eth):
|
||||||
|
ctx.onPeerDisconnected(p)
|
||||||
|
|
||||||
ctx.peerPool.addObserver(ctx, po)
|
ctx.peerPool.addObserver(ctx, po)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue