Browse Source

Fix Web-UI

pool
Sammy Libre 8 years ago
parent
commit
8e8346195a
  1. 4
      config.example.json
  2. 1
      go-pool/pool/pool.go
  3. 8
      go-pool/stratum/stratum.go

4
config.example.json

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

1
go-pool/pool/pool.go

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

8
go-pool/stratum/stratum.go

@ -56,6 +56,14 @@ func NewStratum(cfg *pool.Config) *StratumServer {
timeout, _ := time.ParseDuration(cfg.Stratum.Timeout) timeout, _ := time.ParseDuration(cfg.Stratum.Timeout)
stratum.timeout = 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 // Init block template
stratum.refreshBlockTemplate(false) stratum.refreshBlockTemplate(false)

Loading…
Cancel
Save