mirror of https://github.com/status-im/nim-eth.git
Provide empty RLP list data for devp2p ping/pong messages, for Parity compatibility
This commit is contained in:
parent
325d120274
commit
3d2436d3df
|
@ -20,6 +20,8 @@ type
|
||||||
|
|
||||||
ResponderWithoutId*[MsgType] = distinct Peer
|
ResponderWithoutId*[MsgType] = distinct Peer
|
||||||
|
|
||||||
|
EmptyList = object
|
||||||
|
|
||||||
const
|
const
|
||||||
devp2pVersion* = 4
|
devp2pVersion* = 4
|
||||||
maxMsgSize = 1024 * 1024
|
maxMsgSize = 1024 * 1024
|
||||||
|
@ -777,10 +779,13 @@ p2pProtocol devp2p(version = 0, shortName = "p2p"):
|
||||||
|
|
||||||
proc sendDisconnectMsg(peer: Peer, reason: DisconnectionReason)
|
proc sendDisconnectMsg(peer: Peer, reason: DisconnectionReason)
|
||||||
|
|
||||||
proc ping(peer: Peer) =
|
# Adding an empty RLP list as the spec defines.
|
||||||
discard peer.pong()
|
# The parity client specifically checks if there is rlp data.
|
||||||
|
# TODO: can we do this in the macro instead?
|
||||||
|
proc ping(peer: Peer, emptyList: EmptyList) =
|
||||||
|
discard peer.pong(EmptyList())
|
||||||
|
|
||||||
proc pong(peer: Peer) =
|
proc pong(peer: Peer, emptyList: EmptyList) =
|
||||||
discard
|
discard
|
||||||
|
|
||||||
proc removePeer(network: EthereumNode, peer: Peer) =
|
proc removePeer(network: EthereumNode, peer: Peer) =
|
||||||
|
|
Loading…
Reference in New Issue