Browse Source

Move blockRefreshInterval setting

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

3
config.example.json

@ -9,9 +9,10 @@ @@ -9,9 +9,10 @@
"luckWindow": "24h",
"largeLuckWindow": "72h",
"blockRefreshInterval": "1s",
"stratum": {
"timeout": "15m",
"blockRefreshInterval": "1s",
"listen": [
{

2
go-pool/pool/pool.go

@ -5,6 +5,7 @@ type Config struct { @@ -5,6 +5,7 @@ type Config struct {
BypassAddressValidation bool `json:"bypassAddressValidation"`
BypassShareValidation bool `json:"bypassShareValidation"`
Stratum Stratum `json:"stratum"`
BlockRefreshInterval string `json:"blockRefreshInterval"`
UpstreamCheckInterval string `json:"upstreamCheckInterval"`
Upstream []Upstream `json:"upstream"`
EstimationWindow string `json:"estimationWindow"`
@ -20,7 +21,6 @@ type Config struct { @@ -20,7 +21,6 @@ type Config struct {
type Stratum struct {
Timeout string `json:"timeout"`
BlockRefreshInterval string `json:"blockRefreshInterval"`
Ports []Port `json:"listen"`
}

2
go-pool/stratum/stratum.go

@ -80,7 +80,7 @@ func NewStratum(cfg *pool.Config) *StratumServer { @@ -80,7 +80,7 @@ func NewStratum(cfg *pool.Config) *StratumServer {
// Init block template
stratum.refreshBlockTemplate(false)
refreshIntv, _ := time.ParseDuration(cfg.Stratum.BlockRefreshInterval)
refreshIntv, _ := time.ParseDuration(cfg.BlockRefreshInterval)
refreshTimer := time.NewTimer(refreshIntv)
log.Printf("Set block refresh every %v", refreshIntv)

Loading…
Cancel
Save