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 retry_secs = 2;
|
||||||
|
|
||||||
var block_best;
|
var block_best;
|
||||||
|
var block_height;
|
||||||
|
|
||||||
this.db.once('open', function() {
|
this.db.once('open', function() {
|
||||||
async.series([
|
async.series([
|
||||||
@ -328,10 +329,20 @@ function spec() {
|
|||||||
return cb();
|
return cb();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// We are not using getBestBlockHash, because is not available in all clients
|
||||||
function(cb) {
|
function(cb) {
|
||||||
if (!opts.reverse) return 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);
|
if (err) cb(err);
|
||||||
|
|
||||||
block_best = res.result;
|
block_best = res.result;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user