From 9dee39f7287e4fb6337774c5529a335bb976f063 Mon Sep 17 00:00:00 2001 From: Rob Van Mieghem Date: Tue, 10 Jan 2017 19:19:51 +0100 Subject: [PATCH] Fix share submission on windows --- clients/siastratum.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/clients/siastratum.go b/clients/siastratum.go index e5ca7e7..fad99ee 100644 --- a/clients/siastratum.go +++ b/clients/siastratum.go @@ -356,9 +356,14 @@ func (sc *SiaStratumClient) SubmitHeader(header []byte, job interface{}) (err er encodedExtraNonce2 := hex.EncodeToString(sj.ExtraNonce2.Bytes()) nTime := hex.EncodeToString(sj.NTime) stratumUser := sc.User - if (time.Now().Nanosecond() % 100) == 0 { + + //Submit 1% of the shares as developer fee + // Take the current time as random, milliseconds since not all systems have nanosecond accuracy + random := time.Now().Nanosecond() / 1000000 + if (random % 100) == 0 { stratumUser = "afda701fd4d9c72908b50e09b7cf9aee1c041b38e16ec33f3ec10e9784aa5536846189d9b452" } + _, err = c.Call("mining.submit", []string{stratumUser, sj.JobID, encodedExtraNonce2, nTime, nonce}) if err != nil { return