Documentation ¶
Overview ¶
Package miner implements SHX block creation and mining.
Index ¶
- type Miner
- func (self *Miner) Mining() bool
- func (self *Miner) Pending() (*types.Block, *state.StateDB)
- func (self *Miner) PendingBlock() *types.Block
- func (self *Miner) SetExtra(extra []byte) error
- func (self *Miner) SetOpt(maxtxs, peorid int)
- func (self *Miner) Start(coinbase common.Address)
- func (self *Miner) Stop()
- func (self *Miner) WorkControl()
- type RoundState
- type Work
- type WorkPending
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Miner ¶
type Miner struct {
// contains filtered or unexported fields
}
Miner creates blocks and searches for proof-of-work values.
func (*Miner) PendingBlock ¶
PendingBlock returns the currently pending block.
Note, to access both the pending block and the pending state simultaneously, please use Pending(), as the pending state can change between multiple method calls
func (*Miner) WorkControl ¶
func (self *Miner) WorkControl()
update keeps track of the synctrl events. Please be aware that this is a one shot type of update loop. It's entered once and as soon as `Done` or `Failed` has been broadcasted the events are unregistered and the loop is exited. This to prevent a major security vuln where external parties can DOS you with blocks and halt your mining operation for as long as the DOS continues.
type WorkPending ¶
type WorkPending struct { Pending []*Work // contains filtered or unexported fields }
func NewWorkPending ¶
func NewWorkPending() *WorkPending
func (*WorkPending) Add ¶
func (p *WorkPending) Add(w *Work) bool
func (*WorkPending) Empty ¶
func (p *WorkPending) Empty() bool
func (*WorkPending) HaveErr ¶
func (p *WorkPending) HaveErr() bool
func (*WorkPending) Head ¶
func (p *WorkPending) Head() *Work
func (*WorkPending) Run ¶
func (p *WorkPending) Run()
func (*WorkPending) SetNoError ¶
func (p *WorkPending) SetNoError()
func (*WorkPending) Top ¶
func (p *WorkPending) Top() *Work