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:
cryptonote-social 2021-03-14 10:50:29 -07:00
parent 2be45a76a5
commit 5bc49e88fb
3 changed files with 6 additions and 3 deletions

View File

@ -1,5 +1,7 @@
package main
// +build 386
import "C"
import (

View File

@ -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
}

View File

@ -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"