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'
21
21
import { getENR , shortId } from '../../util/util.js'
22
22
import {
23
23
FoundContent ,
24
- MAX_PACKET_SIZE ,
24
+ MAX_UDP_PACKET_SIZE ,
25
25
RequestCode ,
26
26
encodeWithVariantPrefix ,
27
+ getTalkReqOverhead ,
27
28
randUint16 ,
28
29
} from '../../wire/index.js'
29
30
import { ContentMessageType , MessageCodes , PortalWireMessageType } from '../../wire/types.js'
@@ -573,7 +574,10 @@ export class BeaconLightClientNetwork extends BaseNetwork {
573
574
const value = await this . findContentLocally ( decodedContentMessage . contentKey )
574
575
if ( ! value ) {
575
576
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
+ ) {
577
581
this . logger (
578
582
'Found value for requested content ' +
579
583
bytesToHex ( decodedContentMessage . contentKey ) +
You can’t perform that action at this time.
0 commit comments