diff --git a/lib/expressapp.js b/lib/expressapp.js index cd06558..dd9a381 100644 --- a/lib/expressapp.js +++ b/lib/expressapp.js @@ -173,7 +173,7 @@ ExpressApp.prototype.start = function(opts, cb) { var createWalletLimiter; - if (Defaults.RateLimit.createWallet) { + if (Defaults.RateLimit.createWallet && !opts.ignoreRateLimiter) { log.info('', 'Limiting wallet creation per IP: %d req/h', (Defaults.RateLimit.createWallet.max / Defaults.RateLimit.createWallet.windowMs * 60 * 60 * 1000).toFixed(2)) createWalletLimiter = new RateLimit(Defaults.RateLimit.createWallet); // router.use(/\/v\d+\/wallets\/$/, createWalletLimiter) diff --git a/lib/model/address.js b/lib/model/address.js index 9b024ab..159c29f 100644 --- a/lib/model/address.js +++ b/lib/model/address.js @@ -47,7 +47,7 @@ Address._deriveAddress = function(scriptType, publicKeyRing, path, m, network) { var publicKeys = _.map(publicKeyRing, function(item) { var xpub = new Bitcore.HDPublicKey(item.xPubKey); - return xpub.derive(path).publicKey; + return xpub.deriveChild(path).publicKey; }); var bitcoreAddress; diff --git a/lib/model/txproposal.js b/lib/model/txproposal.js index a6f736b..0294b66 100644 --- a/lib/model/txproposal.js +++ b/lib/model/txproposal.js @@ -333,7 +333,7 @@ TxProposal.prototype._addSignaturesToBitcoreTx = function(tx, signatures, xpub) var input = self.inputs[i]; try { var signature = Bitcore.crypto.Signature.fromString(signatureHex); - var pub = x.derive(self.inputPaths[i]).publicKey; + var pub = x.deriveChild(self.inputPaths[i]).publicKey; var s = { inputIndex: i, signature: signature, diff --git a/lib/server.js b/lib/server.js index bacc384..de91056 100644 --- a/lib/server.js +++ b/lib/server.js @@ -472,7 +472,7 @@ WalletService.prototype._verifySignature = function(text, signature, pubkey) { * @param xPubKey */ WalletService.prototype._verifyRequestPubKey = function(requestPubKey, signature, xPubKey) { - var pub = (new Bitcore.HDPublicKey(xPubKey)).derive(Constants.PATHS.REQUEST_KEY_AUTH).publicKey; + var pub = (new Bitcore.HDPublicKey(xPubKey)).deriveChild(Constants.PATHS.REQUEST_KEY_AUTH).publicKey; return Utils.verifyMessage(requestPubKey, signature, pub.toString()); }; @@ -2017,7 +2017,7 @@ WalletService.prototype.createTx = function(opts, cb) { }); }; WalletService.prototype._verifyRequestPubKey = function(requestPubKey, signature, xPubKey) { - var pub = (new Bitcore.HDPublicKey(xPubKey)).derive(Constants.PATHS.REQUEST_KEY_AUTH).publicKey; + var pub = (new Bitcore.HDPublicKey(xPubKey)).deriveChild(Constants.PATHS.REQUEST_KEY_AUTH).publicKey; return Utils.verifyMessage(requestPubKey, signature, pub.toString()); }; @@ -2814,6 +2814,7 @@ WalletService.prototype.getTxHistory = function(opts, cb) { var bc = self._getBlockchainExplorer(network); bc.getTransactions(addressStrs, from, to, function(err, rawTxs, total) { if (err) return next(err); + txs = self._normalizeTxHistory(rawTxs); totalItems = total; return next(); diff --git a/package.json b/package.json index b6e00f3..f827087 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "bitcore-wallet-service", "description": "A service for Mutisig HD Bitcoin Wallets", "author": "BitPay Inc", - "version": "1.14.0", + "version": "1.15.0", "licence": "MIT", "keywords": [ "bitcoin", @@ -70,18 +70,14 @@ "coveralls": "./node_modules/.bin/istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage" }, "bitcoreNode": "./bitcorenode", - "contributors": [ - { - "name": "Braydon Fuller", - "email": "braydon@bitpay.com" - }, - { - "name": "Ivan Socolsky", - "email": "ivan@bitpay.com" - }, - { - "name": "Matias Alejo Garcia", - "email": "ematiu@gmail.com" - } - ] + "contributors": [{ + "name": "Braydon Fuller", + "email": "braydon@bitpay.com" + }, { + "name": "Ivan Socolsky", + "email": "ivan@bitpay.com" + }, { + "name": "Matias Alejo Garcia", + "email": "ematiu@gmail.com" + }] } diff --git a/test/integration/helpers.js b/test/integration/helpers.js index ec49d5b..825d0af 100644 --- a/test/integration/helpers.js +++ b/test/integration/helpers.js @@ -88,7 +88,7 @@ helpers.signMessage = function(text, privKey) { }; helpers.signRequestPubKey = function(requestPubKey, xPrivKey) { - var priv = new Bitcore.HDPrivateKey(xPrivKey).derive(Constants.PATHS.REQUEST_KEY_AUTH).privateKey; + var priv = new Bitcore.HDPrivateKey(xPrivKey).deriveChild(Constants.PATHS.REQUEST_KEY_AUTH).privateKey; return helpers.signMessage(requestPubKey, priv); }; @@ -113,18 +113,18 @@ helpers._generateCopayersTestData = function(n) { var xpriv = new Bitcore.HDPrivateKey(); var xpub = Bitcore.HDPublicKey(xpriv); - var xpriv_45H = xpriv.derive(45, true); + var xpriv_45H = xpriv.deriveChild(45, true); var xpub_45H = Bitcore.HDPublicKey(xpriv_45H); var id45 = Copayer._xPubToCopayerId(xpub_45H.toString()); - var xpriv_44H_0H_0H = xpriv.derive(44, true).derive(0, true).derive(0, true); + var xpriv_44H_0H_0H = xpriv.deriveChild(44, true).deriveChild(0, true).deriveChild(0, true); var xpub_44H_0H_0H = Bitcore.HDPublicKey(xpriv_44H_0H_0H); var id44 = Copayer._xPubToCopayerId(xpub_44H_0H_0H.toString()); - var xpriv_1H = xpriv.derive(1, true); + var xpriv_1H = xpriv.deriveChild(1, true); var xpub_1H = Bitcore.HDPublicKey(xpriv_1H); - var priv = xpriv_1H.derive(0).privateKey; - var pub = xpub_1H.derive(0).publicKey; + var priv = xpriv_1H.deriveChild(0).privateKey; + var pub = xpub_1H.deriveChild(0).publicKey; console.log('{id44: ', "'" + id44 + "',"); console.log('id45: ', "'" + id45 + "',"); @@ -374,7 +374,7 @@ helpers.clientSign = function(txp, derivedXPrivKey) { _.each(txp.inputs, function(i) { if (!derived[i.path]) { - derived[i.path] = xpriv.derive(i.path).privateKey; + derived[i.path] = xpriv.deriveChild(i.path).privateKey; privs.push(derived[i.path]); } });