remove call to getBestBlockHash (not in all bitcoind clients)
This commit is contained in:
parent
07f0108dfa
commit
35ff54aea7
13
lib/Sync.js
13
lib/Sync.js
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue