check range for search.
This commit is contained in:
parent
34a44fe391
commit
8f3667b866
@ -1214,6 +1214,7 @@ Pool.prototype.search = function search(id, range, e) {
|
|||||||
// chain by default
|
// chain by default
|
||||||
if (!range.end)
|
if (!range.end)
|
||||||
range.end = utils.now();
|
range.end = utils.now();
|
||||||
|
|
||||||
if (!range.start)
|
if (!range.start)
|
||||||
range.start = utils.now() - 432000;
|
range.start = utils.now() - 432000;
|
||||||
|
|
||||||
@ -1255,14 +1256,11 @@ Pool.prototype.search = function search(id, range, e) {
|
|||||||
|
|
||||||
timeout = setTimeout(done.bind(null, true), total);
|
timeout = setTimeout(done.bind(null, true), total);
|
||||||
|
|
||||||
this.chain.resetTime(range.start);
|
if (range.start < this.chain.getTip().ts) {
|
||||||
|
this.chain.resetTime(range.start);
|
||||||
this.stopSync();
|
this.stopSync();
|
||||||
|
this.startSync();
|
||||||
if (this.peers.load)
|
}
|
||||||
this.peers.load.destroy();
|
|
||||||
|
|
||||||
this.startSync();
|
|
||||||
|
|
||||||
return e;
|
return e;
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user