diff --git a/docs/services/bitcoind.md b/docs/services/bitcoind.md index 5cf83203..5ad14bff 100644 --- a/docs/services/bitcoind.md +++ b/docs/services/bitcoind.md @@ -92,7 +92,6 @@ console.log(spent); - `bitcoind.start(callback)` - Start the JavaScript Bitcoin node, the callback is called when the daemon is ready. - `bitcoind.getInfo()` - Basic information about the chain including total number of blocks. -- `bitcoind.getTxOutSetInfo()` - Basic information about the chain including total number of blocks. - `bitcoind.isSynced()` - Returns a boolean if the daemon is fully synced (not the initial block download) - `bitcoind.syncPercentage()` - Returns the current estimate of blockchain download as a percentage. - `bitcoind.stop(callback)` - Stop the JavaScript bitcoin node safely, the callback will be called when bitcoind is closed. This will also be done automatically on `process.exit`. It also takes the bitcoind node off the libuv event loop. If the daemon object is the only thing on the event loop. Node will simply close. diff --git a/integration/regtest.js b/integration/regtest.js index 68521c77..e734bfcc 100644 --- a/integration/regtest.js +++ b/integration/regtest.js @@ -410,27 +410,6 @@ describe('Daemon Binding Functionality', function() { }); }); - describe('get transaction output set information', function() { - var bestblock; - it('will get the correct info', function() { - var info = bitcoind.getTxOutSetInfo(); - info.bestblock.should.be.a('string'); - bestblock = info.bestblock; - info.bestblock.length.should.equal(64); - info.bytes_serialized.should.equal(10431); - info.hash_serialized.should.be.a('string'); - info.hash_serialized.length.should.equal(64); - info.height.should.equal(151); - info.total_amount.should.equal(750000000000); - info.transactions.should.equal(151); - info.txouts.should.equal(151); - }); - it('will get the best block hash', function() { - var best = bitcoind.getBestBlockHash(); - best.should.equal(bestblock); - }); - }); - describe('get next block hash', function() { it('will get next block hash', function() { var nextBlockHash = bitcoind.getNextBlockHash(blockHashes[0]); diff --git a/lib/services/bitcoind.js b/lib/services/bitcoind.js index 1d08addb..80920c67 100644 --- a/lib/services/bitcoind.js +++ b/lib/services/bitcoind.js @@ -315,24 +315,6 @@ Bitcoin.prototype.getNextBlockHash = function(hash) { return bindings.getNextBlockHash(hash); }; -/** - * This query is expensive and can take quite a while to return. It will give - * statistics about the database, in the format: - * { - * height: 151, - * bestblock: '085241174bf5c9d606e591b3cbf52f9306f3d6aca50ea77604ca898472dc4669', - * transactions: 151, - * txouts: 151, - * bytes_serialized: 10431, - * hash_serialized: 'b1e42afb98d0d9f1978c048648685590a7ef0be46f83f509fc0d0668d6a39d8c', - * total_amount: 750000000000 - * } - * @returns {Object} - */ -Bitcoin.prototype.getTxOutSetInfo = function() { - return bindings.getTxOutSetInfo(); -}; - /** * This will return information about the database in the format: * { diff --git a/src/libbitcoind.cc b/src/libbitcoind.cc index 9d3838dc..9dc68d83 100644 --- a/src/libbitcoind.cc +++ b/src/libbitcoind.cc @@ -207,27 +207,6 @@ NAN_METHOD(SyncPercentage) { info.GetReturnValue().Set(progress * 100); }; -NAN_METHOD(GetTxOutSetInfo) { - { - LOCK(cs_main); - CCoinsStats stats; - FlushStateToDisk(); - if (pcoinsTip->GetStats(stats)) { - Local obj = New(); - Set(obj, New("height").ToLocalChecked(), New((int64_t)stats.nHeight)); - Set(obj, New("bestblock").ToLocalChecked(), New(stats.hashBlock.GetHex().c_str()).ToLocalChecked()); - Set(obj, New("transactions").ToLocalChecked(), New((int64_t)stats.nTransactions)); - Set(obj, New("txouts").ToLocalChecked(), New((int64_t)stats.nTransactionOutputs)); - Set(obj, New("bytes_serialized").ToLocalChecked(), New((int64_t)stats.nSerializedSize)); - Set(obj, New("hash_serialized").ToLocalChecked(), New(stats.hashSerialized.GetHex()).ToLocalChecked()); - Set(obj, New("total_amount").ToLocalChecked(), New(stats.nTotalAmount)); - info.GetReturnValue().Set(obj); - return; - } - } - info.GetReturnValue().Set(Null()); -}; - NAN_METHOD(GetBestBlockHash) { LOCK(cs_main); info.GetReturnValue().Set(New(chainActive.Tip()->GetBlockHash().GetHex()).ToLocalChecked()); @@ -1558,7 +1537,6 @@ NAN_MODULE_INIT(init) { Set(target, New("startTxMon").ToLocalChecked(), GetFunction(New(StartTxMon)).ToLocalChecked()); Set(target, New("syncPercentage").ToLocalChecked(), GetFunction(New(SyncPercentage)).ToLocalChecked()); Set(target, New("isSynced").ToLocalChecked(), GetFunction(New(IsSynced)).ToLocalChecked()); - Set(target, New("getTxOutSetInfo").ToLocalChecked(), GetFunction(New(GetTxOutSetInfo)).ToLocalChecked()); Set(target, New("getBestBlockHash").ToLocalChecked(), GetFunction(New(GetBestBlockHash)).ToLocalChecked()); Set(target, New("getNextBlockHash").ToLocalChecked(), GetFunction(New(GetNextBlockHash)).ToLocalChecked()); } diff --git a/test/services/bitcoind.unit.js b/test/services/bitcoind.unit.js index ec911372..03853647 100644 --- a/test/services/bitcoind.unit.js +++ b/test/services/bitcoind.unit.js @@ -408,7 +408,6 @@ describe('Bitcoin Service', function() { ['getTransactionWithBlockInfo', 3], ['getMempoolTransactions', 0], ['addMempoolUncheckedTransaction', 1], - ['getTxOutSetInfo', 0], ['getBestBlockHash', 0], ['getNextBlockHash', 1], ['getInfo', 0]