mirror of
https://github.com/cryptonote-social/csminer.git
synced 2024-07-14 16:50:35 +03:00
changes for using rxlib in randomx repo instead of standalone, plus tweak to stop mining when connection to server is lost
This commit is contained in:
parent
2be45a76a5
commit
5bc49e88fb
@ -1,5 +1,7 @@
|
||||
package main
|
||||
|
||||
// +build 386
|
||||
|
||||
import "C"
|
||||
|
||||
import (
|
||||
|
@ -388,6 +388,7 @@ func MiningLoop(jobChan <-chan *client.MultiClientJob, done chan<- bool) {
|
||||
crylog.Info("reconnect failed. sleeping for", sleepSec, "seconds before trying again")
|
||||
time.Sleep(sleepSec)
|
||||
sleepSec += time.Second
|
||||
stopWorkers() // stop hashing if we're unable to reconnect since we can't submit shares
|
||||
continue
|
||||
}
|
||||
// Set up fresh stats for new connection
|
||||
@ -681,7 +682,7 @@ func goMine(job client.MultiClientJob, thread int) {
|
||||
go func(fnonce, jobid string) {
|
||||
// If the client isn't alive, then sleep for a bit and hope it wakes up
|
||||
// before the share goes stale.
|
||||
for {
|
||||
for i := 0; i < 100; i++ {
|
||||
if cl.IsAlive() {
|
||||
break
|
||||
}
|
||||
|
4
rx/rx.go
4
rx/rx.go
@ -4,8 +4,8 @@
|
||||
// Package rx provides Go access to various randomx library methods.
|
||||
package rx
|
||||
|
||||
// #cgo CFLAGS: -std=c11 -D_GNU_SOURCE -m64 -O3 -I${SRCDIR}/../../rxlib/
|
||||
// #cgo LDFLAGS: -L${SRCDIR}/../../rxlib/ -Wl,-rpath,$ORIGIN ${SRCDIR}/../../rxlib/rxlib.cpp.o -lrandomx -lstdc++ -lm
|
||||
// #cgo CFLAGS: -std=c11 -D_GNU_SOURCE -m64 -O3 -I${SRCDIR}/../../RandomX/rxlib/
|
||||
// #cgo LDFLAGS: -L${SRCDIR}/../../RandomX/rxlib/ -Wl,-rpath,$ORIGIN ${SRCDIR}/../../RandomX/rxlib/rxlib.cpp.o -lrandomx -lstdc++ -lm
|
||||
/*
|
||||
#include <stdlib.h>
|
||||
#include "rxlib.h"
|
||||
|
Loading…
Reference in New Issue
Block a user