From dffff280f7ee2ddbe2b9662965305dd6b80aa824 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Tue, 29 Mar 2016 17:54:54 -0700 Subject: [PATCH] api --- lib/bcoin/fullnode.js | 6 +----- lib/bcoin/http/client.js | 2 +- lib/bcoin/http/server.js | 4 ++-- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/bcoin/fullnode.js b/lib/bcoin/fullnode.js index cfbd9d60..b9fdeaa0 100644 --- a/lib/bcoin/fullnode.js +++ b/lib/bcoin/fullnode.js @@ -97,7 +97,6 @@ Fullnode.prototype._init = function _init() { self.emit('error', err); }); - if (0) this.on('tx', function(tx) { self.walletdb.addTX(tx, function(err) { if (err) @@ -117,8 +116,6 @@ Fullnode.prototype._init = function _init() { self.emit('tx', tx); }); - // Update the mempool. - if (0) this.chain.on('add block', function(block) { self.mempool.addBlock(block, function(err) { if (err) @@ -126,7 +123,6 @@ Fullnode.prototype._init = function _init() { }); }); - if (0) this.chain.on('remove block', function(block) { self.mempool.removeBlock(block, function(err) { if (err) @@ -282,7 +278,7 @@ Fullnode.prototype.getCoin = function getCoin(hash, index, callback) { }); }; -Fullnode.prototype.getCoinByAddress = function getCoinByAddress(addresses, callback) { +Fullnode.prototype.getCoinsByAddress = function getCoinsByAddress(addresses, callback) { var self = this; this.mempool.getCoinsByAddress(addresses, function(err, coins) { if (err) diff --git a/lib/bcoin/http/client.js b/lib/bcoin/http/client.js index e8cad56f..2c9c2e74 100644 --- a/lib/bcoin/http/client.js +++ b/lib/bcoin/http/client.js @@ -283,7 +283,7 @@ Client.prototype.syncWallet = function syncWallet(id, options, callback) { }); }; -Client.prototype.getCoinByAddress = function getCoinByAddress(address, callback) { +Client.prototype.getCoinsByAddress = function getCoinsByAddress(address, callback) { var body = { addresses: address }; return this._post('/coin/address', body, function(err, body) { diff --git a/lib/bcoin/http/server.js b/lib/bcoin/http/server.js index 82f00f21..3713f596 100644 --- a/lib/bcoin/http/server.js +++ b/lib/bcoin/http/server.js @@ -128,7 +128,7 @@ NodeServer.prototype._init = function _init() { // UTXO by address this.get('/coin/address/:address', function(req, res, next, send) { - self.node.getCoinByAddress(req.options.addresses, function(err, coins) { + self.node.getCoinsByAddress(req.options.addresses, function(err, coins) { if (err) return next(err); @@ -154,7 +154,7 @@ NodeServer.prototype._init = function _init() { // Bulk read UTXOs this.post('/coin/address', function(req, res, next, send) { - self.node.getCoinByAddress(req.body.addresses, function(err, coins) { + self.node.getCoinsByAddress(req.body.addresses, function(err, coins) { if (err) return next(err);