mirror of
https://github.com/cryptonote-social/csminer.git
synced 2024-10-26 14:09:53 +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
|
package main
|
||||||
|
|
||||||
|
// +build 386
|
||||||
|
|
||||||
import "C"
|
import "C"
|
||||||
|
|
||||||
import (
|
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")
|
crylog.Info("reconnect failed. sleeping for", sleepSec, "seconds before trying again")
|
||||||
time.Sleep(sleepSec)
|
time.Sleep(sleepSec)
|
||||||
sleepSec += time.Second
|
sleepSec += time.Second
|
||||||
|
stopWorkers() // stop hashing if we're unable to reconnect since we can't submit shares
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
// Set up fresh stats for new connection
|
// Set up fresh stats for new connection
|
||||||
@ -681,7 +682,7 @@ func goMine(job client.MultiClientJob, thread int) {
|
|||||||
go func(fnonce, jobid string) {
|
go func(fnonce, jobid string) {
|
||||||
// If the client isn't alive, then sleep for a bit and hope it wakes up
|
// If the client isn't alive, then sleep for a bit and hope it wakes up
|
||||||
// before the share goes stale.
|
// before the share goes stale.
|
||||||
for {
|
for i := 0; i < 100; i++ {
|
||||||
if cl.IsAlive() {
|
if cl.IsAlive() {
|
||||||
break
|
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 provides Go access to various randomx library methods.
|
||||||
package rx
|
package rx
|
||||||
|
|
||||||
// #cgo CFLAGS: -std=c11 -D_GNU_SOURCE -m64 -O3 -I${SRCDIR}/../../rxlib/
|
// #cgo CFLAGS: -std=c11 -D_GNU_SOURCE -m64 -O3 -I${SRCDIR}/../../RandomX/rxlib/
|
||||||
// #cgo LDFLAGS: -L${SRCDIR}/../../rxlib/ -Wl,-rpath,$ORIGIN ${SRCDIR}/../../rxlib/rxlib.cpp.o -lrandomx -lstdc++ -lm
|
// #cgo LDFLAGS: -L${SRCDIR}/../../RandomX/rxlib/ -Wl,-rpath,$ORIGIN ${SRCDIR}/../../RandomX/rxlib/rxlib.cpp.o -lrandomx -lstdc++ -lm
|
||||||
/*
|
/*
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "rxlib.h"
|
#include "rxlib.h"
|
||||||
|
Loading…
Reference in New Issue
Block a user