Adding test case and logging
This commit is contained in:
parent
ba08acb6ae
commit
1fa3d45445
@ -14,6 +14,7 @@ var _ = require('lodash');
|
|||||||
var LRU = require('lru-cache');
|
var LRU = require('lru-cache');
|
||||||
|
|
||||||
const MAX_IGNORED_BLOCK = 32; //Maximum ignored block allowed before trigging sync again
|
const MAX_IGNORED_BLOCK = 32; //Maximum ignored block allowed before trigging sync again
|
||||||
|
var __TestingCount = 5;
|
||||||
|
|
||||||
var BlockService = function(options) {
|
var BlockService = function(options) {
|
||||||
|
|
||||||
@ -936,11 +937,17 @@ BlockService.prototype._processBlock = function(block, callback) {
|
|||||||
|
|
||||||
log.debug('Block Service: new block: ' + block.rhash());
|
log.debug('Block Service: new block: ' + block.rhash());
|
||||||
|
|
||||||
|
//Manually ignore a block for testing
|
||||||
|
__TestingCount--;
|
||||||
|
if(__TestingCount === 0)
|
||||||
|
return console.debug("TESTING: Ignored block");
|
||||||
|
|
||||||
// common case
|
// common case
|
||||||
if (!self._detectReorg(block)) {
|
if (!self._detectReorg(block)) {
|
||||||
return self._saveBlock(block, callback);
|
return self._saveBlock(block, callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.debug("TESTING: _ignoredBlockCount=", self._ignoredBlockCount)
|
||||||
//SZ: count the ignored blocks. if many blocks ignored, trigger sync process
|
//SZ: count the ignored blocks. if many blocks ignored, trigger sync process
|
||||||
if(self._ignoredBlockCount < MAX_IGNORED_BLOCK)
|
if(self._ignoredBlockCount < MAX_IGNORED_BLOCK)
|
||||||
self._ignoredBlockCount++;
|
self._ignoredBlockCount++;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user