Fix accidential usage of default rlp decode for DisconnectionReason (#572)

This commit is contained in:
Kim De Mey 2022-12-14 10:57:23 +01:00 committed by GitHub
parent 2b5f2a27e3
commit 40ec601d07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -708,7 +708,7 @@ proc waitSingleMsg(peer: Peer, MsgType: type): Future[MsgType] {.async.} =
"Invalid RLPx message body")
elif nextMsgId == 1: # p2p.disconnect
let reasonList = rlp.read(nextMsgData, DisconnectionReasonList)
let reasonList = nextMsgData.read(DisconnectionReasonList)
let reason = reasonList.value
await peer.disconnect(reason)
trace "disconnect message received in waitSingleMsg", reason, peer