Fix Web-UI

This commit is contained in:
Sammy Libre 2016-12-06 19:21:06 +05:00
parent 89a8c4ac98
commit 8e8346195a
3 changed files with 13 additions and 0 deletions

View File

@ -5,6 +5,10 @@
"threads": 2,
"estimationWindow": "15m",
"luckWindow": "24h",
"largeLuckWindow": "72h",
"stratum": {
"timeout": "15m",
"blockRefreshInterval": "1s",

View File

@ -6,6 +6,7 @@ type Config struct {
BypassShareValidation bool `json:"bypassShareValidation"`
Stratum Stratum `json:"stratum"`
Daemon Daemon `json:"daemon"`
EstimationWindow string `json:"estimationWindow"`
LuckWindow string `json:"luckWindow"`
LargeLuckWindow string `json:"largeLuckWindow"`
Threads int `json:"threads"`

View File

@ -56,6 +56,14 @@ func NewStratum(cfg *pool.Config) *StratumServer {
timeout, _ := time.ParseDuration(cfg.Stratum.Timeout)
stratum.timeout = timeout
estimationWindow, _ := time.ParseDuration(cfg.EstimationWindow)
stratum.estimationWindow = estimationWindow
luckWindow, _ := time.ParseDuration(cfg.LuckWindow)
stratum.luckWindow = int64(luckWindow / time.Millisecond)
luckLargeWindow, _ := time.ParseDuration(cfg.LargeLuckWindow)
stratum.luckLargeWindow = int64(luckLargeWindow / time.Millisecond)
// Init block template
stratum.refreshBlockTemplate(false)