From 870186635622761eb405ef67a5da91df72892092 Mon Sep 17 00:00:00 2001 From: cce <51567+cce@users.noreply.github.com> Date: Thu, 8 Aug 2024 10:10:11 -0400 Subject: [PATCH] reject non-canonical --- data/txHandler.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/data/txHandler.go b/data/txHandler.go index 29b2756a07..7ee5764137 100644 --- a/data/txHandler.go +++ b/data/txHandler.go @@ -808,17 +808,18 @@ func (handler *TxHandler) validateIncomingTxMessage(rawmsg network.IncomingMessa if drop { return network.OutgoingMessage{Action: network.Ignore} } + + if handler.incomingTxGroupAppRateLimit(unverifiedTxGroup, rawmsg.Sender) { + return network.OutgoingMessage{Action: network.Ignore} + } + if reencoded == nil { reencoded = reencode(unverifiedTxGroup) } if !bytes.Equal(rawmsg.Data, reencoded) { - // ignore non-canonically encoded messages - return network.OutgoingMessage{Action: network.Ignore} - } - - if handler.incomingTxGroupAppRateLimit(unverifiedTxGroup, rawmsg.Sender) { - return network.OutgoingMessage{Action: network.Ignore} + // reject non-canonically encoded messages + return network.OutgoingMessage{Action: network.Disconnect} } // apply backlog worker logic