vardiff

package
v0.0.0-...-07a8cb0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RingBuffer

type RingBuffer struct {
	IsFull  bool
	MaxSize int64
	Cursor  int64
	Data    []int64
}

func NewRingBuffer

func NewRingBuffer(maxSize int64) *RingBuffer

func (*RingBuffer) Append

func (rb *RingBuffer) Append(x int64)

func (*RingBuffer) Avg

func (rb *RingBuffer) Avg() float64

func (*RingBuffer) Clear

func (rb *RingBuffer) Clear()

func (*RingBuffer) Size

func (rb *RingBuffer) Size() int64

type VarDiff

type VarDiff struct {
	Options       *config.VarDiffOptions
	BufferSize    int64
	MaxTargetTime float64
	MinTargetTime float64

	TimeBuffer    *RingBuffer
	LastRtc       int64
	LastTimestamp int64
}

func NewVarDiff

func NewVarDiff(options *config.VarDiffOptions) *VarDiff

func (*VarDiff) CalcNextDiff

func (vd *VarDiff) CalcNextDiff(currentDiff float64) (newDiff float64)

On SubmitEvent then client.EnqueueNextDifficulty(newDiff)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL