From 98bc1685b3127c62498c83d6bf6a76be382243d4 Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Fri, 10 Oct 2014 19:24:16 +1100 Subject: [PATCH] message: remove unnecessary verbosity --- src/message.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/message.js b/src/message.js index 35ce866..76ba3f0 100644 --- a/src/message.js +++ b/src/message.js @@ -3,7 +3,6 @@ var crypto = require('./crypto') var ecdsa = require('./ecdsa') var networks = require('./networks') -var Address = require('./address') var BigInteger = require('bigi') var ECPubKey = require('./ecpubkey') var ECSignature = require('./ecsignature') @@ -38,10 +37,6 @@ function verify(address, signature, message, network) { signature = new Buffer(signature, 'base64') } - if (address instanceof Address) { - address = address.toString() - } - network = network || networks.bitcoin var hash = magicHash(message, network) @@ -50,7 +45,7 @@ function verify(address, signature, message, network) { var Q = ecdsa.recoverPubKey(ecparams, e, parsed.signature, parsed.i) var pubKey = new ECPubKey(Q, parsed.compressed) - return pubKey.getAddress(network).toString() === address + return pubKey.getAddress(network).toString() === address.toString() } module.exports = {