Documentation ¶
Index ¶
- Variables
- type BlockInfo
- type SnapshotManager
- func (sn *SnapshotManager) GetCurrentSnapshotHash() (uint64, common.Hash, error)
- func (sn *SnapshotManager) GetLastSnapshotTime() (uint64, error)
- func (sn *SnapshotManager) GetPrevSnapshotTime(time uint64) (uint64, error)
- func (sn *SnapshotManager) GetSnapshotMsg(account string, key string, time uint64) ([]byte, error)
- func (sn *SnapshotManager) GetSnapshotState(time uint64) (*state.StateDB, error)
- func (sn *SnapshotManager) SetSnapshot(time uint64, blockInfo BlockInfo) error
Constants ¶
This section is empty.
Variables ¶
View Source
var SnapshotInterval uint64 = 3600000
Functions ¶
This section is empty.
Types ¶
type BlockInfo ¶
type BlockInfo struct { Number uint64 BlockHash common.Hash Timestamp uint64 // previous snapshot timestamp }
BlockInfo store stateDB
type SnapshotManager ¶
type SnapshotManager struct {
// contains filtered or unexported fields
}
SnapshotManager snapshot manager object
func NewSnapshotManager ¶
func NewSnapshotManager(state *state.StateDB) *SnapshotManager
NewSnapshotManager create manager
func (*SnapshotManager) GetCurrentSnapshotHash ¶
func (sn *SnapshotManager) GetCurrentSnapshotHash() (uint64, common.Hash, error)
func (*SnapshotManager) GetLastSnapshotTime ¶
func (sn *SnapshotManager) GetLastSnapshotTime() (uint64, error)
GetLastSnapshot get last snapshot time
func (*SnapshotManager) GetPrevSnapshotTime ¶
func (sn *SnapshotManager) GetPrevSnapshotTime(time uint64) (uint64, error)
GetPrevSnapshot get previous snapshot time
func (*SnapshotManager) GetSnapshotMsg ¶
func (*SnapshotManager) GetSnapshotState ¶
func (sn *SnapshotManager) GetSnapshotState(time uint64) (*state.StateDB, error)
GetSnapshotState get snapshot state
func (*SnapshotManager) SetSnapshot ¶
func (sn *SnapshotManager) SetSnapshot(time uint64, blockInfo BlockInfo) error
Click to show internal directories.
Click to hide internal directories.