mirror of
https://github.com/cryptonote-social/csminer.git
synced 2024-09-11 05:35:23 +03:00
support for -dev flag
This commit is contained in:
parent
13f698be07
commit
de9ed276fb
@ -28,6 +28,7 @@ var (
|
|||||||
exclude = flag.String("exclude", "", "pause mining during these hours, e.g. -exclude=11-16 will pause mining between 11am and 4pm")
|
exclude = flag.String("exclude", "", "pause mining during these hours, e.g. -exclude=11-16 will pause mining between 11am and 4pm")
|
||||||
config = flag.String("config", "", "advanced pool configuration options, e.g. start_diff=1000;donate=1.0")
|
config = flag.String("config", "", "advanced pool configuration options, e.g. start_diff=1000;donate=1.0")
|
||||||
wallet = flag.String("wallet", "", "your wallet id. only specify this when establishing a new username, or specifying a 'secure' config change such as a change in donation amount")
|
wallet = flag.String("wallet", "", "your wallet id. only specify this when establishing a new username, or specifying a 'secure' config change such as a change in donation amount")
|
||||||
|
dev = flag.Bool("dev", false, "whether to connect to dev server")
|
||||||
)
|
)
|
||||||
|
|
||||||
func MultiMain(s MachineStater, agent string) {
|
func MultiMain(s MachineStater, agent string) {
|
||||||
@ -127,6 +128,7 @@ func MultiMain(s MachineStater, agent string) {
|
|||||||
ExcludeHrEnd: hr2,
|
ExcludeHrEnd: hr2,
|
||||||
UseTLS: *tls,
|
UseTLS: *tls,
|
||||||
AdvancedConfig: *config,
|
AdvancedConfig: *config,
|
||||||
|
Dev: *dev,
|
||||||
}
|
}
|
||||||
if err = Mine(&config); err != nil {
|
if err = Mine(&config); err != nil {
|
||||||
crylog.Fatal("Miner failed:", err)
|
crylog.Fatal("Miner failed:", err)
|
||||||
|
3
miner.go
3
miner.go
@ -69,6 +69,9 @@ func Mine(c *MinerConfig) error {
|
|||||||
|
|
||||||
sleepSec := 3 * time.Second // time to sleep if connection attempt fails
|
sleepSec := 3 * time.Second // time to sleep if connection attempt fails
|
||||||
for {
|
for {
|
||||||
|
if c.Dev {
|
||||||
|
crylog.Warn("\n\n=================\n\nCONNECTING TO DEV SERVER -- THIS IS FOR TESTING ONLY\n\n=================\n\n")
|
||||||
|
}
|
||||||
plResp := minerlib.PoolLogin(&minerlib.PoolLoginArgs{
|
plResp := minerlib.PoolLogin(&minerlib.PoolLoginArgs{
|
||||||
Username: c.Username,
|
Username: c.Username,
|
||||||
RigID: c.RigID,
|
RigID: c.RigID,
|
||||||
|
Loading…
Reference in New Issue
Block a user