diff --git a/app/controllers/node.js b/app/controllers/node.js index 72aa32c9e4c25b5fa76e37091e25af6ec93208f8..49a4ce8a13d183dfdda42cbc47b71a0c87b244ff 100644 --- a/app/controllers/node.js +++ b/app/controllers/node.js @@ -14,7 +14,7 @@ function NodeBinding (server) { "ucoin": { "software": "ucoind", "version": server.version, - "forkWindowSize": server.conf.branchesWindowSize + "forkWindowSize": server.conf.forksize } }, null, " ")); }; diff --git a/app/lib/entity/configuration.js b/app/lib/entity/configuration.js index 06ace73cacb416de59a8a6c5f66701714b4170cf..bfa9353bd1793475013c78b41243883de5759921 100644 --- a/app/lib/entity/configuration.js +++ b/app/lib/entity/configuration.js @@ -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 }; }; diff --git a/app/lib/sync.js b/app/lib/sync.js index 8d032ea4826cde0340db3aa4b0fdce19fcb7df7f..11c87d51c256b10207625350ff160e9f6cad81f5 100644 --- a/app/lib/sync.js +++ b/app/lib/sync.js @@ -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": [ diff --git a/app/service/BlockchainService.js b/app/service/BlockchainService.js index b2b42d79f75c33170c6249d47c04efc62c76d9d1..1135d80d0e9a044bcacbef729a2947e30f14026d 100644 --- a/app/service/BlockchainService.js +++ b/app/service/BlockchainService.js @@ -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); diff --git a/bin/ucoind b/bin/ucoind index 55c40710b4bf64120ce19ed32b48b9825e3c9aa7..9587b5cc6feabfa844c3add46ff015d92aa6bb6c 100755 --- a/bin/ucoind +++ b/bin/ucoind @@ -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; diff --git a/server.js b/server.js index 6928db4587bcef9ecb602ef6e362ce8fd664c4cf..7adfc7ef12e3af10a7cc99726ebf956dd4cf724c 100644 --- a/server.js +++ b/server.js @@ -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) { diff --git a/test/integration/branches.js b/test/integration/branches.js index ec1474ea419a8ce63d0500233df3f1bc4de690c7..099f962d818fafe97b417e4130ff28413385abe2 100644 --- a/test/integration/branches.js +++ b/test/integration/branches.js @@ -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 }; diff --git a/test/integration/branches2.js b/test/integration/branches2.js index bf6e92ce20715dfc3b05d41ecd2a359231f59efe..5b8eca1de87b08b9d89ba30d721a33b467a5d644 100644 --- a/test/integration/branches2.js +++ b/test/integration/branches2.js @@ -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 }; diff --git a/test/integration/branches_pending_data.js b/test/integration/branches_pending_data.js index 0183355b761ca47a2b309b83d50962cbb5b4dfac..8f93fa2b11a1be76534b6d72427537b5ea83408c 100644 --- a/test/integration/branches_pending_data.js +++ b/test/integration/branches_pending_data.js @@ -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 }; diff --git a/test/integration/branches_revert.js b/test/integration/branches_revert.js index b2ed6c7aacb0743c83ec34b710e510580d45b72e..a4c13c7ed9c145208d79501d7f4fb083015dffe7 100644 --- a/test/integration/branches_revert.js +++ b/test/integration/branches_revert.js @@ -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 }; diff --git a/test/integration/branches_revert2.js b/test/integration/branches_revert2.js index 0ab735ea4d91907de65c83d417ecf867a5adc66e..f8a294ef68bbdeffb3fff22354485ad94a11675e 100644 --- a/test/integration/branches_revert2.js +++ b/test/integration/branches_revert2.js @@ -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 }; diff --git a/test/integration/branches_switch.js b/test/integration/branches_switch.js index be5700943963ec66c54c2718e86b8f80e550ecd3..1ea608f1e58f89847e846d5f0b9aee1adc4eacee 100644 --- a/test/integration/branches_switch.js +++ b/test/integration/branches_switch.js @@ -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 }; diff --git a/test/integration/identity-test.js b/test/integration/identity-test.js index 12861f5aefdf3d02eca559c0b6fb4fd28acbad8f..247a705deac8a57fd62a84c4e008c39d45675a1d 100644 --- a/test/integration/identity-test.js +++ b/test/integration/identity-test.js @@ -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 }; diff --git a/test/integration/peerings.js b/test/integration/peerings.js index c50b7c8226118e3a5207bd74afde4b1758af7276..50b9aae0c32a849af2d3c77e10a917e231b7b463 100644 --- a/test/integration/peerings.js +++ b/test/integration/peerings.js @@ -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 }; diff --git a/test/integration/start_generate_blocks.js b/test/integration/start_generate_blocks.js index 5d3a467256896975c58691fd59b9c860a37308e3..cf8ce8c95e9929a74adf8d96a63ee6182f9d1514 100644 --- a/test/integration/start_generate_blocks.js +++ b/test/integration/start_generate_blocks.js @@ -23,7 +23,7 @@ var commonConf = { remoteipv4: '127.0.0.1', currency: 'bb', httpLogs: true, - branchesWindowSize: 0, + forksize: 0, sigQty: 1 }; diff --git a/test/integration/tests.js b/test/integration/tests.js index 68934e7bdffa589cf8989080f9e410bc5ed0c450..87a323ced2fe6181659927345d190194de6e083b 100644 --- a/test/integration/tests.js +++ b/test/integration/tests.js @@ -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 });