File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
packages/portalnetwork/src/networks/beacon Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -21,9 +21,10 @@ import debug from 'debug'
2121import { getENR , shortId } from '../../util/util.js'
2222import {
2323 FoundContent ,
24- MAX_PACKET_SIZE ,
24+ MAX_UDP_PACKET_SIZE ,
2525 RequestCode ,
2626 encodeWithVariantPrefix ,
27+ getTalkReqOverhead ,
2728 randUint16 ,
2829} from '../../wire/index.js'
2930import { ContentMessageType , MessageCodes , PortalWireMessageType } from '../../wire/types.js'
@@ -573,7 +574,10 @@ export class BeaconLightClientNetwork extends BaseNetwork {
573574 const value = await this . findContentLocally ( decodedContentMessage . contentKey )
574575 if ( ! value ) {
575576 await this . enrResponse ( decodedContentMessage . contentKey , src , requestId )
576- } else if ( value !== undefined && value . length < MAX_PACKET_SIZE ) {
577+ } else if (
578+ value !== undefined &&
579+ value . length < MAX_UDP_PACKET_SIZE - getTalkReqOverhead ( hexToBytes ( this . networkId ) . byteLength )
580+ ) {
577581 this . logger (
578582 'Found value for requested content ' +
579583 bytesToHex ( decodedContentMessage . contentKey ) +
You can’t perform that action at this time.
0 commit comments