From 87eea1e398d5f92b894a73ec5afee8321c27bc46 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Fri, 4 Dec 2015 22:50:13 -0800 Subject: [PATCH] fixes and minor style changes --- lib/bcoin/peer.js | 2 +- lib/bcoin/protocol/framer.js | 2 +- lib/bcoin/tx.js | 6 +++--- lib/bcoin/wallet.js | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/bcoin/peer.js b/lib/bcoin/peer.js index a1c87aa0..8bb9d431 100644 --- a/lib/bcoin/peer.js +++ b/lib/bcoin/peer.js @@ -475,7 +475,7 @@ Peer.prototype._handleHeaders = function handleHeaders(headers) { }; -Peer.prototype.loadHeaders = function loadBlocks(hashes, stop) { +Peer.prototype.loadHeaders = function loadHeaders(hashes, stop) { this._write(this.framer.getHeaders(hashes, stop)); }; diff --git a/lib/bcoin/protocol/framer.js b/lib/bcoin/protocol/framer.js index ce6ea7c0..7dfbb213 100644 --- a/lib/bcoin/protocol/framer.js +++ b/lib/bcoin/protocol/framer.js @@ -201,7 +201,7 @@ Framer.prototype.filterClear = function filterClear() { return this.packet('filterclear', []); }; -Framer.prototype.getHeaders = function getBlocks(hashes, stop) { +Framer.prototype.getHeaders = function getHeaders(hashes, stop) { return this._getBlocks('getheaders', hashes, stop); }; diff --git a/lib/bcoin/tx.js b/lib/bcoin/tx.js index 0db08f46..198ed593 100644 --- a/lib/bcoin/tx.js +++ b/lib/bcoin/tx.js @@ -235,14 +235,14 @@ TX.prototype.verify = function verify(index, force) { }, this); }; -TX.prototype.signature = function signature(tx, key, index, sighash) { +TX.prototype.signature = function signature(key, index, sighash) { if (typeof index !== 'number') { index = tx.inputs.indexOf(index); if (index === -1) return; } - var input = tx.inputs[index]; + var input = this.inputs[index]; var subscript = input.out.tx.getSubscript(input.out.index); - var hash = tx.subscriptHash(input, subscript, sighash); + var hash = this.subscriptHash(input, subscript, sighash); var signature = bcoin.ecdsa.sign(hash, key).toDER(); signature = signature.concat(bcoin.protocol.constants.hashType[sighash]); return signature; diff --git a/lib/bcoin/wallet.js b/lib/bcoin/wallet.js index bdce2416..1cc8de97 100644 --- a/lib/bcoin/wallet.js +++ b/lib/bcoin/wallet.js @@ -487,7 +487,7 @@ Wallet.prototype.getP2SH = function(redeem) { var hash = utils.ripasha(redemption); return { hash: hash, - address: bcoin.wallet.hash2addr(hash, 'p2sh'), + address: Wallet.hash2addr(hash, 'p2sh'), redemption: redemption }; }; @@ -495,7 +495,7 @@ Wallet.prototype.getP2SH = function(redeem) { Wallet.prototype._createMultisigRedemption = function() { var publicKeys = this.publicKeys; var mcode = constants.opcodes['1'] + (this.m - 1); - var ncode = script.push(constants.opcodes['1'] + (this.n - 1)); + var ncode = constants.opcodes['1'] + (this.n - 1); var redemption = []; redemption.push(mcode); this.publicKeys.forEach(function(pubkey) {