Commit b6b22889 authored by Cédric Moreau's avatar Cédric Moreau
Browse files

Fix #256 fork window size was still set to zero

parent 98eea3fb
......@@ -14,7 +14,7 @@ function NodeBinding (server) {
"ucoin": {
"software": "ucoind",
"version": server.version,
"forkWindowSize": server.conf.branchesWindowSize
"forkWindowSize": server.conf.forksize
}
}, null, " "));
};
......
......@@ -38,7 +38,7 @@ var defaultConf = function() {
"timeout": 3000,
"routing": false,
"isolate": false,
"branchesWindowSize": constants.BRANCHES.DEFAULT_WINDOW_SIZE
"forksize": constants.BRANCHES.DEFAULT_WINDOW_SIZE
};
};
......
......@@ -21,9 +21,6 @@ module.exports = function Synchroniser (server, host, port, conf, interactive) {
var speed = 0, syncStart = new Date(), blocksApplied = 0;
var watcher = interactive ? new MultimeterWatcher() : new LoggerWatcher();
// Disable branching for the main synchronization parts
conf.branchesWindowSize = 0;
if (interactive) {
require('log4js').configure({
"appenders": [
......
......@@ -196,7 +196,7 @@ function BlockchainService (conf, mainDAL, pair) {
return res;
} else {
// add it as side chain
if (current.number - obj.number + 1 >= conf.branchesWindowSize) {
if (current.number - obj.number + 1 >= conf.forksize) {
throw 'Block out of fork window';
}
let absolute = yield mainDAL.getAbsoluteBlockByNumberAndHash(obj.number, obj.hash);
......
......@@ -727,7 +727,7 @@ function commandLineConf(conf) {
if (cli.db.mdb) conf.mdb = cli.db.mdb;
if (cli.isolate) conf.isolate = cli.isolate;
if (cli.timeout) conf.timeout = cli.timeout;
if (cli.forksize != null) conf.branchesWindowSize = cli.forksize;
if (cli.forksize != null) conf.forksize = cli.forksize;
// Specific internal settings
conf.createNext = true;
......
......@@ -129,7 +129,7 @@ function Server (dbConf, overrideConf) {
dtDiffEval: constants.CONTRACT.DEFAULT.DTDIFFEVAL,
medianTimeBlocks: constants.CONTRACT.DEFAULT.MEDIANTIMEBLOCKS,
rootoffset: 0,
branchesWindowSize: constants.BRANCHES.DEFAULT_WINDOW_SIZE
forksize: constants.BRANCHES.DEFAULT_WINDOW_SIZE
};
_.keys(defaultValues).forEach(function(key){
if (that.conf[key] == undefined) {
......
......@@ -26,7 +26,7 @@ var commonConf = {
ipv4: '127.0.0.1',
currency: 'bb',
httpLogs: true,
branchesWindowSize: 3,
forksize: 3,
parcatipate: false, // TODO: to remove when startGeneration will be an explicit call
sigQty: 1
};
......
......@@ -19,7 +19,7 @@ var commonConf = {
ipv4: '127.0.0.1',
currency: 'bb',
httpLogs: true,
branchesWindowSize: 3,
forksize: 3,
parcatipate: false, // TODO: to remove when startGeneration will be an explicit call
sigQty: 1
};
......
......@@ -18,7 +18,7 @@ var commonConf = {
ipv4: '127.0.0.1',
currency: 'bb',
httpLogs: true,
branchesWindowSize: 3,
forksize: 3,
parcatipate: false, // TODO: to remove when startGeneration will be an explicit call
sigQty: 1
};
......
......@@ -17,7 +17,7 @@ var commonConf = {
ipv4: '127.0.0.1',
currency: 'bb',
httpLogs: true,
branchesWindowSize: 3,
forksize: 3,
parcatipate: false, // TODO: to remove when startGeneration will be an explicit call
sigQty: 1
};
......
......@@ -18,7 +18,7 @@ var commonConf = {
ipv4: '127.0.0.1',
currency: 'bb',
httpLogs: true,
branchesWindowSize: 3,
forksize: 3,
parcatipate: false, // TODO: to remove when startGeneration will be an explicit call
sigQty: 1
};
......
......@@ -19,7 +19,7 @@ var commonConf = {
ipv4: '127.0.0.1',
currency: 'bb',
httpLogs: true,
branchesWindowSize: 3,
forksize: 3,
parcatipate: false, // TODO: to remove when startGeneration will be an explicit call
sigQty: 1
};
......
......@@ -18,7 +18,7 @@ var commonConf = {
ipv4: '127.0.0.1',
currency: 'bb',
httpLogs: true,
branchesWindowSize: 3,
forksize: 3,
parcatipate: false, // TODO: to remove when startGeneration will be an explicit call
sigQty: 1
};
......
......@@ -26,7 +26,7 @@ var commonConf = {
remoteipv4: '127.0.0.1',
currency: 'bb',
httpLogs: true,
branchesWindowSize: 3,
forksize: 3,
parcatipate: false, // TODO: to remove when startGeneration will be an explicit call
sigQty: 1
};
......
......@@ -23,7 +23,7 @@ var commonConf = {
remoteipv4: '127.0.0.1',
currency: 'bb',
httpLogs: true,
branchesWindowSize: 0,
forksize: 0,
sigQty: 1
};
......
......@@ -125,7 +125,7 @@ describe("Integration", function() {
pub: 'DNann1Lh55eZMEDXeYt59bzHbA3NJR46DeQYCS2qQdLV',
sec: '468Q1XtTq7h84NorZdWBZFJrGkB18CbmbHr9tkp9snt5GiERP7ySs3wM8myLccbAAGejgMRC9rqnXuW3iAfZACm7'
},
branchesWindowSize: 3,
forksize: 3,
participate: false, rootoffset: 10,
sigQty: 1, dt: 0, ud0: 120
});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment