remove call to getBestBlockHash (not in all bitcoind clients)

This commit is contained in:
Matias Alejo Garcia 2014-01-16 15:07:37 -03:00
parent 07f0108dfa
commit 35ff54aea7
1 changed files with 12 additions and 1 deletions

View File

@ -293,6 +293,7 @@ function spec() {
var retry_secs = 2;
var block_best;
var block_height;
this.db.once('open', function() {
async.series([
@ -328,10 +329,20 @@ function spec() {
return cb();
});
},
// We are not using getBestBlockHash, because is not available in all clients
function(cb) {
if (!opts.reverse) return cb();
that.rpc.getBestBlockHash(function(err, res) {
that.rpc.getBlockCount(function(err, res) {
if (err) cb(err);
block_height = res.result;
return cb();
});
},
function(cb) {
if (!opts.reverse) return cb();
that.rpc.getBlockHash(block_height, function(err, res) {
if (err) cb(err);
block_best = res.result;