Fix bid position and claim sequence regexes

This commit is contained in:
Alex Liebowitz 2017-04-10 21:18:37 -04:00
parent 96bd8285f4
commit 839e629362

View file

@ -74,12 +74,12 @@ uri.parseLbryUri = function(lbryUri, requireProto=false) {
throw new Error(`Invalid claim ID ${claimId}.`); throw new Error(`Invalid claim ID ${claimId}.`);
} }
if (bidPosition && !bidPosition.match(/^-?[1-9][0-9]+$/)) { if (claimSequence && !claimSequence.match(/^-?[1-9][0-9]*$/)) {
throw new Error('Bid position must be a number.'); throw new Error('Claim sequence must be a number.');
} }
if (claimSequence && !claimSequence.match(/^-?[1-9][0-9]+$/)) { if (bidPosition && !bidPosition.match(/^-?[1-9][0-9]*$/)) {
throw new Error('Claim sequence must be a number.'); throw new Error('Bid position must be a number.');
} }
// Validate path // Validate path