diff --git a/integration/index.js b/integration/index.js index 14da0300..c48bbd6f 100644 --- a/integration/index.js +++ b/integration/index.js @@ -62,7 +62,7 @@ describe('Basic Functionality', function() { }); }); - describe.only('determine if outpoint is unspent/spent', function() { + describe('determine if outpoint is unspent/spent', function() { spentData.forEach(function(data) { it('for spent txid ' + data.txid + ' and output ' + data.outputIndex, function() { var spent = bitcoind.isSpent(data.txid, data.outputIndex, true); diff --git a/integration/livenet-spents.json b/integration/livenet-spents.json index d8b84e52..8c1eed28 100644 --- a/integration/livenet-spents.json +++ b/integration/livenet-spents.json @@ -3,6 +3,14 @@ { "txid": "0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098", "outputIndex": 0 + }, + { + "txid": "64b2da257d93ab44d19ef9b374788d82b6885bc3fb3c17704f42f09b1096e982", + "outputIndex": 0 + }, + { + "txid": "226bbc4b1f851857f37aa96e9eb702946fc128b055e4decc684740005f5044cf", + "outputIndex": 0 } ], "spent": [ diff --git a/lib/bitcoind.js b/lib/bitcoind.js index e9b6095a..bb022a84 100644 --- a/lib/bitcoind.js +++ b/lib/bitcoind.js @@ -323,8 +323,8 @@ Bitcoin.prototype.getBlockHeight = function(height, callback) { }); }; -Bitcoin.prototype.isSpent = function(txid, outputIndex, queryMempool) { - return bitcoindjs.isSpent(txid, outputIndex, queryMempool); +Bitcoin.prototype.isSpent = function(txid, outputIndex) { + return bitcoindjs.isSpent(txid, outputIndex); }; Bitcoin.prototype.getTransaction = diff --git a/src/bitcoindjs.cc b/src/bitcoindjs.cc index b77bdb78..61dc487a 100644 --- a/src/bitcoindjs.cc +++ b/src/bitcoindjs.cc @@ -939,18 +939,15 @@ async_get_tx_after(uv_work_t *req) { NAN_METHOD(IsSpent) { NanScope(); - if (args.Length() > 3) { + if (args.Length() > 2) { return NanThrowError( - "Usage: bitcoindjs.isSpent(txid, outputIndex, queryMempool)"); + "Usage: bitcoindjs.isSpent(txid, outputIndex)"); } - // XXX: include the mempool in the coins viewcache - String::Utf8Value arg(args[0]->ToString()); std::string argStr = std::string(*arg); const uint256 txid = uint256S(argStr); int outputIndex = args[1]->IntegerValue(); - bool queryMempool = args[2]->BooleanValue(); CCoinsView dummy; CCoinsViewCache view(&dummy);