disk

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: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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 CleanupBlockRevFiles added in v0.0.3

func CleanupBlockRevFiles() (err error)

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 GetBlkFiles added in v0.0.3

func GetBlkFiles() (blkFiles []string, err error)

func GetBlockPosFilename

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

func GetBlockPosParentFilename

func GetBlockPosParentFilename() string

func GetPruneState

func GetPruneState() *persist.PruneState

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 *model.BitcoinParams) (*block.Block, bool)

func ReadBlockFromDiskByPos added in v0.0.3

func ReadBlockFromDiskByPos(pos block.DiskBlockPos, param *model.BitcoinParams) (blk *block.Block, err error)

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