lib

package
v0.0.0-...-5738362 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package lib provides mempool file primitives and functionality to load a mempool.dat file.

You'd want to be calling ReadMempoolFromPath( ) to read a mempool.dat file. See https://github.com/0xB10C/mempool-dat for some usage examples.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileHeader

type FileHeader struct {
	// contains filtered or unexported fields
}

FileHeader represents the mempool file header

func (FileHeader) GetTxCount

func (header FileHeader) GetTxCount() int64

GetTxCount returns the number of transactions in the corresponding file

func (FileHeader) GetVersion

func (header FileHeader) GetVersion() int64

GetVersion returns the mempool file version

func (FileHeader) String

func (header FileHeader) String() string

returns the version and the number of transactions in the file

type Mempool

type Mempool struct {
	// contains filtered or unexported fields
}

Mempool represents a parsed mempool.dat file

func ReadMempoolFromPath

func ReadMempoolFromPath(path string) (mem Mempool, err error)

ReadMempoolFromPath reads a mempool file from a given path and returns a Mempool type

func (Mempool) GetFileHeader

func (mempool Mempool) GetFileHeader() FileHeader

GetFileHeader returns a the mempool file header

func (Mempool) GetMapDeltas

func (mempool Mempool) GetMapDeltas() []byte

GetMapDeltas returns a byte slice of not parsed mapDelta entries

func (Mempool) GetMempoolEntries

func (mempool Mempool) GetMempoolEntries() []MempoolEntry

GetMempoolEntries returns a slice with mempool entries

type MempoolEntry

type MempoolEntry struct {
	// contains filtered or unexported fields
}

MempoolEntry represents a mempool entry

func (MempoolEntry) GetFeeDelta

func (entry MempoolEntry) GetFeeDelta() int64

GetFeeDelta returns feeDelta of the entry

func (MempoolEntry) GetFirstSeen

func (entry MempoolEntry) GetFirstSeen() int64

GetFirstSeen returns the firstSeen time of the entry as timestamp

func (MempoolEntry) Info

func (entry MempoolEntry) Info() string

Info returns a string with information for a given MempoolEntry

func (MempoolEntry) String

func (entry MempoolEntry) String() string

returns the transaction hash of the entry

Jump to

Keyboard shortcuts

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