Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Snapshot ¶
Snapshot encompasses a snapshot of entire blockchain state. It consists of a patricia state tree and the nonce set.
Nonces maps a nonce entry's ID to the time (in Unix millis) at which it should expire from the nonce set.
TODO: consider making type Snapshot truly immutable. We already handle it that way in many places (with explicit calls to Copy to get the right behavior). PruneNonces and the Apply functions would have to produce new Snapshots rather than updating Snapshots in place.
func Copy ¶
Copy makes a copy of provided snapshot. Copying a snapshot is an O(n) operation where n is the number of nonces in the snapshot's nonce set.
func (*Snapshot) ApplyBlock ¶
ApplyBlock updates s in place.
func (*Snapshot) PruneNonces ¶
PruneNonces modifies a Snapshot, removing all nonce IDs with expiration times earlier than the provided timestamp.