Stop the sync
Stopping the sync on header service and block service.
This commit is contained in:
parent
17dd83de10
commit
4d8d9f15a2
@ -1089,6 +1089,10 @@ BlockService.prototype._startSync = function() {
|
|||||||
|
|
||||||
var numNeeded = Math.max(this._header.getLastHeader().height - this._tip.height, 0);
|
var numNeeded = Math.max(this._header.getLastHeader().height - this._tip.height, 0);
|
||||||
|
|
||||||
|
//Ranchimall: stop sync [Changes: adding the following 2 lines]
|
||||||
|
log.info('RM-BlockService: original numNeeded: ' + numNeeded + '. Resetting to 0')
|
||||||
|
numNeeded = 0;
|
||||||
|
//End of changes
|
||||||
log.info('Block Service: Gathering: ' + numNeeded + ' block(s) from the peer-to-peer network.');
|
log.info('Block Service: Gathering: ' + numNeeded + ' block(s) from the peer-to-peer network.');
|
||||||
|
|
||||||
if (numNeeded > 0) {
|
if (numNeeded > 0) {
|
||||||
|
|||||||
@ -523,10 +523,12 @@ HeaderService.prototype._onHeadersSave = function(callback) {
|
|||||||
|
|
||||||
self._logProgress();
|
self._logProgress();
|
||||||
|
|
||||||
|
/* Ranchimall: Stopping the sync [changes: commented the if block]
|
||||||
if (!self._syncComplete()) {
|
if (!self._syncComplete()) {
|
||||||
self._sync();
|
self._sync();
|
||||||
return callback();
|
return callback();
|
||||||
}
|
}
|
||||||
|
END of changes */
|
||||||
|
|
||||||
self._endHeaderSubscription(); // we don't need headers any more
|
self._endHeaderSubscription(); // we don't need headers any more
|
||||||
self._startBlockSubscription(); // we need new blocks coming tu us aynchronuously
|
self._startBlockSubscription(); // we need new blocks coming tu us aynchronuously
|
||||||
@ -703,6 +705,11 @@ HeaderService.prototype._startSync = function() {
|
|||||||
self._reorging = false;
|
self._reorging = false;
|
||||||
var numNeeded = Math.max(self._bestHeight, self._originalHeight) - self._tip.height;
|
var numNeeded = Math.max(self._bestHeight, self._originalHeight) - self._tip.height;
|
||||||
|
|
||||||
|
//Ranchimall: stopping sync [Changes: adding the following 3 lines
|
||||||
|
log.info('RM-HeaderService: self._tip.height: ' + self._tip.height)
|
||||||
|
log.info('RM-HeaderService: original numNeeded: ' + numNeeded +'. Resetting to 0')
|
||||||
|
numNeeded = 0;
|
||||||
|
//End of changes
|
||||||
// common case
|
// common case
|
||||||
if (numNeeded > 0) {
|
if (numNeeded > 0) {
|
||||||
log.info('Header Service: Gathering: ' + numNeeded + ' ' + 'header(s) from the peer-to-peer network.');
|
log.info('Header Service: Gathering: ' + numNeeded + ' ' + 'header(s) from the peer-to-peer network.');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user