Removed unneeded and slow getTxOutSetInfo

This commit is contained in:
Chris Kleeschulte 2015-09-25 11:17:20 -04:00
parent bb0412f1c8
commit 999a669c53
3 changed files with 0 additions and 50 deletions

View File

@ -220,7 +220,6 @@ Where "xxx" can be:
* getInfo
* getDifficulty
* getTxOutSetInfo
* getBestBlockHash
* getLastBlockHash

View File

@ -12,9 +12,6 @@ StatusController.prototype.show = function(req, res) {
case 'getDifficulty':
res.jsonp(this.getDifficulty());
break;
case 'getTxOutSetInfo':
res.jsonp(this.getTxOutSetInfo());
break;
case 'getLastBlockHash':
res.jsonp(this.getLastBlockHash());
break;
@ -34,20 +31,6 @@ StatusController.prototype.getInfo = function() {
};
};
StatusController.prototype.getTxOutSetInfo = function() {
var hash = this.node.services.bitcoind.getBestBlockHash();
if (hash === this.lastTxOutSetInfo) {
return {
txoutsetinfo: this.txOutSetInfo
};
}
this.txOutSetInfo = this.node.services.bitcoind.getTxOutSetInfo();
this.lastTxOutSetInfo = this.txOutSetInfo.bestblock;
return {
txoutsetinfo: this.txOutSetInfo
};
};
StatusController.prototype.getLastBlockHash = function() {
var hash = this.node.services.db.tip.hash;
return {

View File

@ -32,7 +32,6 @@ describe('Status', function() {
services: {
bitcoind: {
getInfo: sinon.stub().returns(info),
getTxOutSetInfo: sinon.stub().returns(outSetInfo),
getBestBlockHash: sinon.stub().returns(outSetInfo.bestblock)
},
db: {
@ -82,37 +81,6 @@ describe('Status', function() {
status.show(req, res);
});
it('getTxOutSetInfo', function(done) {
var req = {
query: {
q: 'getTxOutSetInfo'
}
};
var res = {
jsonp: function(data) {
data.txoutsetinfo.should.equal(outSetInfo);
done();
}
};
status.show(req, res);
});
it('getTxOutSetInfo (cached)', function(done) {
var req = {
query: {
q: 'getTxOutSetInfo'
}
};
var res = {
jsonp: function(data) {
data.txoutsetinfo.should.equal(outSetInfo);
done();
}
};
status.node.services.bitcoind.getTxOutSetInfo.callCount.should.equal(1);
status.show(req, res);
});
it('getBestBlockHash', function(done) {
var req = {
query: {