take out modifying behavior to estimateFee
This commit is contained in:
parent
43ec2d3b34
commit
d6d9c6a975
@ -123,12 +123,6 @@ DB.prototype.sendTransaction = function(tx, callback) {
|
|||||||
DB.prototype.estimateFee = function(blocks, callback) {
|
DB.prototype.estimateFee = function(blocks, callback) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
// For some reason getting fee for 1 block returns -1
|
|
||||||
// Until this is resolved, just make it 2 blocks
|
|
||||||
if(blocks === 1) {
|
|
||||||
blocks = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
setImmediate(function() {
|
setImmediate(function() {
|
||||||
callback(null, self.bitcoind.estimateFee(blocks));
|
callback(null, self.bitcoind.estimateFee(blocks));
|
||||||
});
|
});
|
||||||
|
|||||||
@ -196,21 +196,6 @@ describe('Bitcoin DB', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe("#estimateFee", function() {
|
describe("#estimateFee", function() {
|
||||||
// To accommodate weird bitcoind behavior where 1 block always results in -1
|
|
||||||
it('should set blocks to 2 if 1 was passed in', function(done) {
|
|
||||||
var db = new DB({store: memdown});
|
|
||||||
db.bitcoind = {
|
|
||||||
estimateFee: sinon.stub().returns(1000)
|
|
||||||
};
|
|
||||||
|
|
||||||
db.estimateFee(1, function(err, fee) {
|
|
||||||
should.not.exist(err);
|
|
||||||
fee.should.equal(1000);
|
|
||||||
db.bitcoind.estimateFee.args[0][0].should.equal(2);
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should pass along the fee from bitcoind', function(done) {
|
it('should pass along the fee from bitcoind', function(done) {
|
||||||
var db = new DB({store: memdown});
|
var db = new DB({store: memdown});
|
||||||
db.bitcoind = {
|
db.bitcoind = {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user