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

Method updateSnapshot

miner/engine.go:476–487  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

474}
475
476func (e *engine) updateSnapshot() {
477 e.snapshotMu.Lock()
478 defer e.snapshotMu.Unlock()
479
480 e.snapshotBlock = types.NewBlock(
481 e.currentWork.header,
482 e.currentWork.txs,
483 e.currentWork.pubReceipts,
484 )
485 e.snapshotState = e.currentWork.pubState.Copy()
486 // TODO: if need to snapshot private state?
487}
488
489// transactions are applied in ascending nonce order of each account.
490func (w *Work) commitTransactions(mux *event.TypeMux, txs *types.TransactionsByPriceAndNonce, bc *core.BlockChain, coinbase common.Address, breakTimer time.Time) {

Callers 2

updateMethod · 0.95
commitNewWorkMethod · 0.95

Calls 3

LockMethod · 0.80
UnlockMethod · 0.80
CopyMethod · 0.45

Tested by

no test coverage detected