Skip to content

Commit 76dedc0

Browse files
committed
[ETCM-102] Break connection in case of decoding failure
1 parent cd44ef1 commit 76dedc0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/main/scala/io/iohk/ethereum/network/rlpx/RLPxConnectionHandler.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ class RLPxConnectionHandler(
163163

164164
case Failure(ex) =>
165165
log.debug(s"Cannot decode message from $peerId, because of ${ex.getMessage}")
166+
// break connection in case of failed decoding, to avoid attack which would send us garbage
167+
context stop self
166168
}
167169

168170
/**

0 commit comments

Comments
 (0)