From 08fe9ab18da6c13e1ce7c1e87e02f981585ef3a6 Mon Sep 17 00:00:00 2001 From: Matt Date: Wed, 26 Feb 2014 22:57:22 -0700 Subject: [PATCH] Was not logging invalid found blocks correctly --- coins/litecoin_testnet_example.json | 19 ++++++++----------- init.js | 6 +++--- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/coins/litecoin_testnet_example.json b/coins/litecoin_testnet_example.json index df4fdcf..21d7e0d 100644 --- a/coins/litecoin_testnet_example.json +++ b/coins/litecoin_testnet_example.json @@ -8,31 +8,28 @@ "stratumPort": 3334, "difficulty": 8, "blockRefreshInterval": 1000, - "daemon": [ - { //first daemon instance + { "host": "localhost", "port": 19332, "user": "litecoinrpc", "password": "testnet" }, - { //backup daemon instance + { "host": "localhost", "port": 19344, "user": "litecoinrpc", "password": "testnet" } ], - "varDiff": { - "enabled": true, //set to false to disable vardiff functionality - "minDifficulty": 8, //minimum difficulty. below 16 will cause problems - "maxDifficulty": 1000, //network difficulty will be used if it is lower than this - "targetTime": 60, //target time per share (i.e. try to get 1 share per this many seconds) - "retargetTime": 10, //check to see if we should retarget every this many seconds - "variancePercent": 10 //allow average time to very this % from target without retarget + "enabled": true, + "minDifficulty": 16, + "maxDifficulty": 1000, + "targetTime": 30, + "retargetTime": 120, + "variancePercent": 20 }, - "p2p": { "enabled": true, "host": "localhost", diff --git a/init.js b/init.js index 9f061da..7931aa2 100644 --- a/init.js +++ b/init.js @@ -55,12 +55,12 @@ fs.readdirSync('coins').forEach(function(file){ var shareData = JSON.stringify(data); - if (isValidBlock) + if (data.solution && !isValidBlock) + logDebug(coinOptions.name, 'client', 'We thought a block solution was found but it was rejected by the daemon, share data: ' + shareData); + else if (isValidBlock) logDebug(coinOptions.name, 'client', 'Block found, share data: ' + shareData); else if (isValidShare) logDebug(coinOptions.name, 'client', 'Valid share submitted, share data: ' + shareData); - else if (data.solution) - logDebug(coinOptions.name, 'client', 'We thought a block solution was found but it was rejected by the daemon, share data: ' + shareData); else logDebug(coinOptions.name, 'client', 'Invalid share submitted, share data: ' + shareData)