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

Method pending

miner/engine.go:159–170  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

157}
158
159func (e *engine) pending() (*types.Block, *state.StateDB) {
160 if atomic.LoadInt32(&e.mining) == 0 {
161 // return a snapshot to avoid contention on currentMu mutex
162 e.snapshotMu.RLock()
163 defer e.snapshotMu.RUnlock()
164 return e.snapshotBlock, e.snapshotState.Copy()
165 }
166
167 e.currentMu.RLock()
168 defer e.currentMu.RUnlock()
169 return e.currentWork.Block, e.currentWork.pubState.Copy()
170}
171
172func (e *engine) pendingBlock() *types.Block {
173 if atomic.LoadInt32(&e.mining) == 0 {

Callers 1

PendingMethod · 0.80

Calls 1

CopyMethod · 0.45

Tested by

no test coverage detected