gitlab.com/SiaPrime/SiaPrime@v1.4.1/modules/miningpool/job.go (about)

     1  package pool
     2  
     3  import (
     4  	"gitlab.com/SiaPrime/SiaPrime/crypto"
     5  )
     6  
     7  //
     8  // A Job in the stratum server is a unit of work which is passed to the client miner to solve.  It is primarily
     9  // identified by a Job ID and this is used to keep track of what work has been assigned to each client
    10  //
    11  type Job struct {
    12  	JobID           uint64
    13  	MarshalledBlock []byte
    14  	MerkleRoot      crypto.Hash
    15  	SubmitedNonce   map[string]bool
    16  }
    17  
    18  func newJob(p *Pool) (*Job, error) {
    19  	id := p.newStratumID()
    20  	j := &Job{
    21  		JobID: id(),
    22  	}
    23  	return j, nil
    24  }
    25  
    26  func (j *Job) printID() string {
    27  	return sPrintID(j.JobID)
    28  }