persist

package
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2018 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MaxBlockFileSize is the maximum size of a blk?????.dat file (since 0.8) */
	MaxBlockFileSize = uint32(0x8000000)
	// BlockFileChunkSize is the pre-allocation chunk size for blk?????.dat files (since 0.8)
	BlockFileChunkSize = 0x1000000
	// UndoFileChunkSize is the pre-allocation chunk size for rev?????.dat files (since 0.8) */
	UndoFileChunkSize     = 0x100000
	DefaultMaxMemPoolSize = 300
)

Variables

View Source
var (
	CsMain          = new(sync.RWMutex)
	CsLastBlockFile = new(sync.RWMutex)

	Reindex bool
)

Functions

func InitPersistGlobal

func InitPersistGlobal()

Types

type PersistGlobal

type PersistGlobal struct {
	GlobalBlockFileInfo                                  []*block.BlockFileInfo
	GlobalLastBlockFile                                  int32 //last block file no.
	GlobalLastWrite, GlobalLastFlush, GlobalLastSetChain int   // last update time
	DefaultMaxMemPoolSize                                uint
	GlobalDirtyFileInfo                                  map[int32]bool // temp for update file info
	GlobalDirtyBlockIndex                                map[util.Hash]*blockindex.BlockIndex
	GlobalTimeReadFromDisk                               int64
	GlobalTimeConnectTotal                               int64
	GlobalTimeChainState                                 int64
	GlobalTimeFlush                                      int64
	GlobalTimeCheck                                      time.Duration
	GlobalTimeForks                                      time.Duration
	GlobalTimePostConnect                                int64
	GlobalTimeTotal                                      int64
	GlobalBlockSequenceID                                int32
	GlobalMapBlocksUnlinked                              map[*blockindex.BlockIndex][]*blockindex.BlockIndex
}

func GetInstance

func GetInstance() *PersistGlobal

func (*PersistGlobal) AddBlockSequenceID

func (pg *PersistGlobal) AddBlockSequenceID()

func (*PersistGlobal) AddDirtyBlockIndex

func (pg *PersistGlobal) AddDirtyBlockIndex(pindex *blockindex.BlockIndex)

type PruneState

type PruneState struct {
	PruneMode       bool
	HavePruned      bool
	PruneTarget     uint64
	CheckForPruning bool
}

func InitPruneState

func InitPruneState() *PruneState

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL