Browse Source

PublicKey: Remove compressed boolean from validation, not nessassary.

patch-2
Braydon Fuller 10 years ago
parent
commit
012466d411
  1. 8
      lib/publickey.js

8
lib/publickey.js

@ -248,10 +248,10 @@ PublicKey.fromX = function(odd, x) {
* @param {String} [compressed] - If the public key is compressed * @param {String} [compressed] - If the public key is compressed
* @returns {null|Error} An error if exists * @returns {null|Error} An error if exists
*/ */
PublicKey.getValidationError = function(data, compressed) { PublicKey.getValidationError = function(data) {
var error; var error;
try { try {
new PublicKey(data, compressed); new PublicKey(data);
} catch (e) { } catch (e) {
error = e; error = e;
} }
@ -266,8 +266,8 @@ PublicKey.getValidationError = function(data, compressed) {
* @param {String} [compressed] - If the public key is compressed * @param {String} [compressed] - If the public key is compressed
* @returns {Boolean} If the public key would be valid * @returns {Boolean} If the public key would be valid
*/ */
PublicKey.isValid = function(data, compressed) { PublicKey.isValid = function(data) {
return !PublicKey.getValidationError(data, compressed); return !PublicKey.getValidationError(data);
}; };
/** /**

Loading…
Cancel
Save