Add ValidateFirstOutboundMessage just before DeFramer (#2391)

This takes care of the current requirements as well as provide the possibility of adding other channel handlers before that like for example a TLS handler

Signed-off-by: Saravana Perumal Shanmugam <perusworld@linux.com>
pull/2283/head
Saravana Perumal Shanmugam 4 years ago committed by GitHub
parent 33a9541eef
commit b81a481a42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/rlpx/connections/netty/AbstractHandshakeHandler.java

@ -114,8 +114,8 @@ abstract class AbstractHandshakeHandler extends SimpleChannelInboundHandler<Byte
ctx.channel()
.pipeline()
.addFirst(new ValidateFirstOutboundMessage(framer))
.replace(this, "DeFramer", deFramer);
.replace(this, "DeFramer", deFramer)
.addBefore("DeFramer", "validate", new ValidateFirstOutboundMessage(framer));
ctx.writeAndFlush(new OutboundMessage(null, HelloMessage.create(localNode.getPeerInfo())))
.addListener(

Loading…
Cancel
Save