From b4a96d709e182192147785393ee0faab3425e1e3 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Tue, 9 Dec 2014 10:02:34 -0800 Subject: [PATCH] cleanup getTx. --- lib/bitcoind.js | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/lib/bitcoind.js b/lib/bitcoind.js index 68fdd033..843dbe5a 100644 --- a/lib/bitcoind.js +++ b/lib/bitcoind.js @@ -411,28 +411,6 @@ Bitcoin.prototype.getTx = function(txid, blockhash, callback) { if (err) return callback(err); return callback(null, bitcoin.tx(tx)); }); - - if (blockhash && typeof blockhash === 'string') { - return bitcoindjs.getTransaction(txid, blockhash, function(err, tx) { - if (err) return callback(err); - if (tx.blockhash) { - bitcoin.db.set('tx-block/' + txid, - { hash: tx.blockhash }, utils.NOOP); - } - return callback(null, bitcoin.tx(tx)); - }); - } - - return bitcoin.db.get('tx-block/' + txid, function(err, block) { - return bitcoinjs.getTransaction(txid, block ? block.hash : '', function(err, tx) { - if (err) return callback(err); - if (!block && tx.blockhash) { - bitcoin.db.set('tx-block/' + txid, - { hash: tx.blockhash }, utils.NOOP); - } - return callback(null, bitcoin.tx(tx)); - }); - }); }; Bitcoin.prototype.getTransactionWithBlock = function(txid, blockhash, callback) {