Skip to content

Commit 2379d37

Browse files
authored
Merge pull request #1427 from 0chain/fix/validator-check
Add validation ticket check on validator ID
2 parents d6ba242 + 8b9b8be commit 2379d37

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

code/go/0chain.net/blobbercore/challenge/protocol.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,19 @@ func (cr *ChallengeEntity) LoadValidationTickets(ctx context.Context) error {
286286
return
287287
}
288288

289+
if validationTicket.ValidatorID != validatorID {
290+
numFailed++
291+
logging.Logger.Error(
292+
"[challenge]resp: ",
293+
zap.String("validator",
294+
validatorID),
295+
zap.Any("resp", string(resp)),
296+
zap.Any("error", "Validator ID mismatch"),
297+
)
298+
updateMapAndSlice(validatorID, i, nil)
299+
return
300+
}
301+
289302
logging.Logger.Info(
290303
"[challenge]resp: Got response from the validator.",
291304
zap.Any("validator_response", validationTicket),

0 commit comments

Comments
 (0)