Skip to content

Commit

Permalink
Fix share submission on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
robvanmieghem committed Jan 10, 2017
1 parent e5203b5 commit 9dee39f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion clients/siastratum.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9dee39f

Please sign in to comment.