uptoexisting -> to to tip block
This commit is contained in:
parent
a35fcc776d
commit
6cef1eaec3
|
@ -320,6 +320,7 @@ function spec() {
|
|||
var self = this;
|
||||
|
||||
var lastBlock;
|
||||
var tip;
|
||||
|
||||
async.series([
|
||||
function(cb) {
|
||||
|
@ -333,7 +334,6 @@ function spec() {
|
|||
function (cb) { return self.getBlockCount(cb); },
|
||||
function(cb) {
|
||||
if (!scanOpts.reverse) return cb();
|
||||
|
||||
self.rpc.getBlockHash(self.blockChainHeight, function(err, res) {
|
||||
if (err) return cb(err);
|
||||
lastBlock = res.result;
|
||||
|
@ -341,6 +341,17 @@ function spec() {
|
|||
return cb();
|
||||
});
|
||||
},
|
||||
function(cb) {
|
||||
if (!scanOpts.reverse) return cb();
|
||||
self.sync.bDb.getTip(function(err, res) {
|
||||
if (err) return cb(err);
|
||||
tip = res;
|
||||
|
||||
console.log('Old Tip:', tip);
|
||||
return cb();
|
||||
});
|
||||
},
|
||||
|
||||
function(cb) {
|
||||
if (scanOpts.upToExisting) {
|
||||
// should be isOrphan = true or null to be more accurate.
|
||||
|
@ -378,7 +389,7 @@ function spec() {
|
|||
|
||||
if (scanOpts.reverse) {
|
||||
start = lastBlock;
|
||||
end = self.genesis;
|
||||
end = tip || self.genesis;
|
||||
scanOpts.prev = true;
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Reference in New Issue