Skip to content

Commit

Permalink
fixed ban time, updated default to 1 hour
Browse files Browse the repository at this point in the history
  • Loading branch information
pascal-triangle committed Jan 15, 2019
1 parent c6cda10 commit cbfbd06
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion config-mainnet.json
Expand Up @@ -179,7 +179,7 @@
"enabled": true,

/* How many seconds to ban worker for*/
"time": 600,
"time": 3600,

/* What percent of invalid shares triggers ban */
"invalidPercent": 50,
Expand Down
2 changes: 1 addition & 1 deletion config-testnet.json
Expand Up @@ -179,7 +179,7 @@
"enabled": true,

/* How many seconds to ban worker for*/
"time": 600,
"time": 3600,

/* What percent of invalid shares triggers ban */
"invalidPercent": 50,
Expand Down
3 changes: 2 additions & 1 deletion lib/stratum.js
Expand Up @@ -399,8 +399,9 @@ var StratumServer = exports.Server = function StratumServer(authorizeFn) {
if(poolCfg.banning && poolCfg.banning.enabled) {
for(ip in bannedIPs) {
var banTime = bannedIPs[ip];
if(Date.now() - banTime > poolCfg.banning.time)
if(Date.now() - banTime > bannedMS) {
delete bannedIPs[ip];
}

}
}
Expand Down

0 comments on commit cbfbd06

Please sign in to comment.