MCPcopy Create free account
hub / github.com/CPChain/chain / NativeWorker

Struct NativeWorker

miner/worker.go:16–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14)
15
16type NativeWorker struct {
17 mu sync.Mutex
18
19 workCh chan *Work // miner.engine must call this to send in work
20 quitCh chan struct{}
21 quitCurrentOpCh chan struct{}
22 returnCh chan<- *Result // miner.engine must set this to retrieve the mined block
23
24 chain consensus.ChainReader // need to access blocks
25 cons consensus.Engine // need to seal methods
26
27 isMining int32 // isMining indicates whether the agent is currently mining
28}
29
30func NewNativeWorker(chain consensus.ChainReader, cons consensus.Engine) *NativeWorker {
31 worker := &NativeWorker{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected