File tree 1 file changed +7
-7
lines changed 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -932,13 +932,6 @@ export default class Gossipsub extends EventEmitter {
932
932
async validateReceivedMessage ( propagationSource : PeerId , rpcMsg : RPC . IMessage ) : Promise < ReceivedMessageResult > {
933
933
this . metrics ?. onMsgRecvPreValidation ( rpcMsg . topic )
934
934
935
- // Perform basic validation on message and convert to RawGossipsubMessage for fastMsgIdFn()
936
- const validationResult = await validateToRawMessage ( this . globalSignaturePolicy , rpcMsg )
937
-
938
- if ( ! validationResult . valid ) {
939
- return { code : MessageStatus . invalid , reason : RejectReason . Error , error : validationResult . error }
940
- }
941
-
942
935
// Fast message ID stuff
943
936
const fastMsgIdStr = this . fastMsgIdFn ?.( rpcMsg )
944
937
const msgIdCached = fastMsgIdStr && this . fastMsgIdCache ?. get ( fastMsgIdStr )
@@ -948,6 +941,13 @@ export default class Gossipsub extends EventEmitter {
948
941
return { code : MessageStatus . duplicate , msgId : msgIdCached }
949
942
}
950
943
944
+ // Perform basic validation on message and convert to RawGossipsubMessage for fastMsgIdFn()
945
+ const validationResult = await validateToRawMessage ( this . globalSignaturePolicy , rpcMsg )
946
+
947
+ if ( ! validationResult . valid ) {
948
+ return { code : MessageStatus . invalid , reason : RejectReason . Error , error : validationResult . error }
949
+ }
950
+
951
951
// Try and perform the data transform to the message. If it fails, consider it invalid.
952
952
let data : Uint8Array
953
953
try {
You can’t perform that action at this time.
0 commit comments