fix: mining always starts, RVN pool in Calibrate, USB repacked
This commit is contained in:
@@ -16,6 +16,10 @@ type Config struct {
|
||||
Pool PoolConfig `json:"pool"`
|
||||
Wallet WalletConfig `json:"wallet"`
|
||||
|
||||
// Ravencoin / GPU mining defaults — pre-populated in Forge when set here.
|
||||
RvnPool PoolConfig `json:"rvn_pool,omitempty"`
|
||||
RvnWallet WalletConfig `json:"rvn_wallet,omitempty"`
|
||||
|
||||
// Legacy JSON fields — ignored at runtime; Forge bakes per-miner settings into installers.
|
||||
DefaultAgent AgentDefaults `json:"default_agent_config,omitempty"`
|
||||
Background BackgroundConfig `json:"background,omitempty"`
|
||||
@@ -131,6 +135,19 @@ func DefaultConfig() *Config {
|
||||
Address: "",
|
||||
PaymentID: "",
|
||||
},
|
||||
RvnPool: PoolConfig{
|
||||
Host: "rvn.2miners.com",
|
||||
Port: 6060,
|
||||
UseTLS: false,
|
||||
Password: "x",
|
||||
BackupPools: []PoolEndpoint{
|
||||
{Host: "stratum-ravencoin.flypool.org", Port: 3333, UseTLS: false},
|
||||
{Host: "kawpow.herominers.com", Port: 1130, UseTLS: false},
|
||||
},
|
||||
},
|
||||
RvnWallet: WalletConfig{
|
||||
Address: "",
|
||||
},
|
||||
DefaultAgent: AgentDefaults{
|
||||
Threads: 4,
|
||||
ThreadMode: "percent",
|
||||
@@ -240,6 +257,22 @@ func mergeConfig(dst, src *Config) {
|
||||
if src.Wallet.PaymentID != "" {
|
||||
dst.Wallet.PaymentID = src.Wallet.PaymentID
|
||||
}
|
||||
if src.RvnPool.Host != "" {
|
||||
dst.RvnPool.Host = src.RvnPool.Host
|
||||
}
|
||||
if src.RvnPool.Port != 0 {
|
||||
dst.RvnPool.Port = src.RvnPool.Port
|
||||
}
|
||||
dst.RvnPool.UseTLS = src.RvnPool.UseTLS
|
||||
if src.RvnPool.Password != "" {
|
||||
dst.RvnPool.Password = src.RvnPool.Password
|
||||
}
|
||||
if len(src.RvnPool.BackupPools) > 0 {
|
||||
dst.RvnPool.BackupPools = append([]PoolEndpoint(nil), src.RvnPool.BackupPools...)
|
||||
}
|
||||
if src.RvnWallet.Address != "" {
|
||||
dst.RvnWallet.Address = src.RvnWallet.Address
|
||||
}
|
||||
if src.DefaultAgent.Threads != 0 {
|
||||
dst.DefaultAgent.Threads = src.DefaultAgent.Threads
|
||||
}
|
||||
@@ -450,6 +483,32 @@ func mergeConfigExplicit(dst, src *Config, present map[string]json.RawMessage) {
|
||||
}
|
||||
}
|
||||
|
||||
if has("rvn_pool") {
|
||||
rvnPoolKeys := nestedJSONKeys(present, "rvn_pool")
|
||||
if in(rvnPoolKeys, "host") && src.RvnPool.Host != "" {
|
||||
dst.RvnPool.Host = src.RvnPool.Host
|
||||
}
|
||||
if in(rvnPoolKeys, "port") && src.RvnPool.Port != 0 {
|
||||
dst.RvnPool.Port = src.RvnPool.Port
|
||||
}
|
||||
if in(rvnPoolKeys, "use_tls") {
|
||||
dst.RvnPool.UseTLS = src.RvnPool.UseTLS
|
||||
}
|
||||
if in(rvnPoolKeys, "password") && src.RvnPool.Password != "" {
|
||||
dst.RvnPool.Password = src.RvnPool.Password
|
||||
}
|
||||
if in(rvnPoolKeys, "backup_pools") {
|
||||
dst.RvnPool.BackupPools = append([]PoolEndpoint(nil), src.RvnPool.BackupPools...)
|
||||
}
|
||||
}
|
||||
|
||||
if has("rvn_wallet") {
|
||||
rvnWalletKeys := nestedJSONKeys(present, "rvn_wallet")
|
||||
if in(rvnWalletKeys, "address") && src.RvnWallet.Address != "" {
|
||||
dst.RvnWallet.Address = src.RvnWallet.Address
|
||||
}
|
||||
}
|
||||
|
||||
// The JSON struct tag is "default_agent_config" — must match exactly.
|
||||
if has("default_agent_config") {
|
||||
daKeys := nestedJSONKeys(present, "default_agent_config")
|
||||
|
||||
Reference in New Issue
Block a user