disk

package
v0.0.0-...-e2b9c72 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2018 License: BSD-2-Clause Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ChainActive chain.Chain
)

Functions

func AllocateFileRange

func AllocateFileRange(file *os.File, offset uint32, length uint32)

func CalculateCurrentUsage

func CalculateCurrentUsage() uint64

CalculateCurrentUsage Calculate the amount of disk space the block & undo files currently use

func CheckDiskSpace

func CheckDiskSpace(nAdditionalBytes uint32) bool

func FindBlockPos

func FindBlockPos(pos *block.DiskBlockPos, nAddSize uint32,
	nHeight int32, nTime uint64, fKnown bool) bool

func FindFilesToPrune

func FindFilesToPrune(setFilesToPrune *set.Set, nPruneAfterHeight uint64)

FindFilesToPrune calculate the block/rev files that should be deleted to remain under target

func FindFilesToPruneManual

func FindFilesToPruneManual(setFilesToPrune *set.Set, manualPruneHeight int)

func FindUndoPos

func FindUndoPos(nFile int32, undoPos *block.DiskBlockPos, nAddSize int) error

func FlushBlockFile

func FlushBlockFile(fFinalize bool)

func FlushStateToDisk

func FlushStateToDisk(mode FlushStateMode, nManualPruneHeight int) error

func GetBlockPosFilename

func GetBlockPosFilename(pos block.DiskBlockPos, prefix string) string

func GetBlockPosParentFilename

func GetBlockPosParentFilename() string

func OpenBlockFile

func OpenBlockFile(pos *block.DiskBlockPos, fReadOnly bool) *os.File

func OpenDiskFile

func OpenDiskFile(pos block.DiskBlockPos, prefix string, fReadOnly bool) *os.File

func OpenUndoFile

func OpenUndoFile(pos block.DiskBlockPos, fReadOnly bool) *os.File

func PruneOneBlockFile

func PruneOneBlockFile(fileNumber int32)

PruneOneBlockFile prune a block file (modify associated database entries)

func ReadBlockFromDisk

func ReadBlockFromDisk(pindex *blockindex.BlockIndex, param *chainparams.BitcoinParams) (*block.Block, bool)

func UndoReadFromDisk

func UndoReadFromDisk(pos *block.DiskBlockPos, hashblock util.Hash) (*undo.BlockUndo, bool)

func UndoWriteToDisk

func UndoWriteToDisk(bu *undo.BlockUndo, pos *block.DiskBlockPos, hashBlock util.Hash, messageStart wire.BitcoinNet) error

func UnlinkPrunedFiles

func UnlinkPrunedFiles(setFilesToPrune *set.Set)

func WriteBlockToDisk

func WriteBlockToDisk(block *block.Block, pos *block.DiskBlockPos) bool

Types

type FlushStateMode

type FlushStateMode int
const (
	FlushStateNone FlushStateMode = iota
	FlushStateIfNeeded
	FlushStatePeriodic
	FlushStateAlways
)

Jump to

Keyboard shortcuts

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