Documentation
¶
Index ¶
- Constants
- Variables
- func GetTestMsg() *testData
- func SerializeShare(enonce2, ntime, nonce, vmask string) shareBytes
- func ValidateDiff(en1 string, en2_size uint, job_diff uint64, version_mask string, ...) (uint64, bool)
- type MiningJob
- type Validator
- func (v *Validator) AddNewJob(msg *sm.MiningNotify, diff float64, xn1 string, xn2size int)
- func (v *Validator) GetLatestJob() (*MiningJob, bool)
- func (v *Validator) HasJob(jobID string) bool
- func (v *Validator) ScheduleCleanJobs()
- func (v *Validator) SetVersionRollingMask(mask string)
- func (v *Validator) ValidateAndAddShare(msg *sm.MiningSubmit) (float64, error)
Constants ¶
View Source
const (
JOB_CACHE_SIZE = 30
)
Variables ¶
View Source
var ( ErrJobNotFound = errors.New("job not found") ErrLowDifficulty = errors.New("low difficulty") )
Functions ¶
func GetTestMsg ¶
func GetTestMsg() *testData
func SerializeShare ¶
func SerializeShare(enonce2, ntime, nonce, vmask string) shareBytes
SerializeShare serializes the share into a 20-byte array. It includes only the fields that are unique for each share per job per destination
func ValidateDiff ¶
func ValidateDiff(en1 string, en2_size uint, job_diff uint64, version_mask string, job *stratumv1_message.MiningNotify, submit *stratumv1_message.MiningSubmit) (uint64, bool)
Types ¶
type MiningJob ¶
type MiningJob struct {
// contains filtered or unexported fields
}
func NewMiningJob ¶
func (*MiningJob) CheckDuplicateAndAddShare ¶
func (m *MiningJob) CheckDuplicateAndAddShare(s *sm.MiningSubmit) bool
func (*MiningJob) GetExtraNonce1 ¶
func (*MiningJob) GetExtraNonce2Size ¶
func (*MiningJob) GetNotify ¶
func (m *MiningJob) GetNotify() *sm.MiningNotify
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
func NewValidator ¶
func (*Validator) GetLatestJob ¶
func (*Validator) ScheduleCleanJobs ¶
func (v *Validator) ScheduleCleanJobs()
func (*Validator) SetVersionRollingMask ¶
func (*Validator) ValidateAndAddShare ¶
func (v *Validator) ValidateAndAddShare(msg *sm.MiningSubmit) (float64, error)
Click to show internal directories.
Click to hide internal directories.