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

Method start

miner/engine.go:185–199  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

183}
184
185func (e *engine) start() {
186 e.mu.Lock()
187 defer e.mu.Unlock()
188
189 if atomic.LoadInt32(&e.mining) == 0 {
190 // spin up workers
191 for worker := range e.workers {
192 worker.Start()
193 }
194
195 go e.wait()
196 }
197
198 atomic.StoreInt32(&e.mining, 1)
199}
200
201func (e *engine) stop() {
202 e.mu.Lock()

Callers 2

start_miningFunction · 0.45
StartMethod · 0.45

Calls 4

waitMethod · 0.95
LockMethod · 0.80
UnlockMethod · 0.80
StartMethod · 0.65

Tested by

no test coverage detected