Skip to content

Commit

Permalink
refactor restrictFirstNodeSelectionByPublicKey check
Browse files Browse the repository at this point in the history
  • Loading branch information
jairajdev committed Sep 19, 2024
1 parent 156c2a4 commit 15026bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/API.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export function registerRoutes(server: FastifyInstance<Server, IncomingMessage,
const port = signedFirstNodeInfo.nodeInfo.externalPort
const publicKey = signedFirstNodeInfo.nodeInfo.publicKey
if (config.restrictFirstNodeSelectionByPublicKey) {
if (config.firstNodePublicKey !== '' && publicKey !== config.firstNodePublicKey) {
if (publicKey !== config.firstNodePublicKey) {
Logger.mainLogger.error('Invalid publicKey of first node info', signedFirstNodeInfo)

Check warning

Code scanning / CodeQL

Log injection Medium

Log entry depends on a
user-provided value
.
reply.send({ success: false, error: 'Invalid publicKey of first node info' })
return
Expand Down

0 comments on commit 15026bc

Please sign in to comment.