MCPcopy Create free account
hub / github.com/chain/txvm / Start

Method Start

protocol/builder.go:42–52  ·  view source on GitHub ↗
(snapshot *state.Snapshot, timestampMS uint64)

Source from the content-addressed store, hash-verified

40}
41
42func (bb *BlockBuilder) Start(snapshot *state.Snapshot, timestampMS uint64) error {
43 if timestampMS <= snapshot.Header.TimestampMs {
44 return fmt.Errorf("timestamp %d is not greater than prevblock timestamp %d", timestampMS, snapshot.Header.TimestampMs)
45 }
46 bb.snapshot = state.Copy(snapshot)
47 bb.snapshot.PruneNonces(timestampMS)
48 bb.timestampMS = timestampMS
49 bb.txs = nil
50 bb.runlimit = 0
51 return nil
52}
53
54var (
55 // ErrBlockFull happens when trying to add a transaction to a block

Callers 2

buildFunction · 0.95
GenerateBlockMethod · 0.80

Calls 2

CopyFunction · 0.92
PruneNoncesMethod · 0.80

Tested by

no test coverage detected