Skip to content

Commit

Permalink
beacon: respond with ENRs when content not found
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottyPoi committed Oct 23, 2024
1 parent 2428d41 commit a93b2b7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/portalnetwork/src/networks/beacon/beacon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -569,10 +569,9 @@ export class BeaconLightClientNetwork extends BaseNetwork {
decodedContentMessage.contentKey,
)}`,
)

const value = await this.findContentLocally(decodedContentMessage.contentKey)
if (!value || value.length === 0) {
await this.sendResponse(src, requestId, new Uint8Array())
if (!value) {
await this.enrResponse(decodedContentMessage.contentKey, src, requestId)
} else if (value !== undefined && value.length < MAX_PACKET_SIZE) {
this.logger(
'Found value for requested content ' +
Expand Down

0 comments on commit a93b2b7

Please sign in to comment.