mempool

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemPool

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

MemPool represents a very simple memory pool for unconfirmed transactions There is an expiration period for each TX in real implementations.

You can read more about mempool: https://bitcoin.stackexchange.com/questions/46152/how-do-transactions-leave-the-memory-pool https://bitcoin.stackexchange.com/questions/41536/why-does-bitcoin-keep-transactions-in-a-memory-pool

func New

func New() *MemPool

New returns new MemPool

func (*MemPool) Add

func (m *MemPool) Add(tx transaction.Transaction)

Add adds new transaction to the pool

func (*MemPool) DeleteByID

func (m *MemPool) DeleteByID(txHexID string)

DeleteByID removes a transaction with a given transaction hex-encoded ID

func (*MemPool) Get

func (m *MemPool) Get(n int) []transaction.Transaction

Get returns N transactions and cleans the pool

func (*MemPool) GetByID

func (m *MemPool) GetByID(txHexID string) (transaction.Transaction, error)

GetByID returns a transaction with a given transaction hex-encoded ID

func (*MemPool) Read added in v0.1.1

func (m *MemPool) Read(n int) []transaction.Transaction

Read returns N transactions without cleaning

func (*MemPool) Size

func (m *MemPool) Size() int

Size return size of the MemPool

Jump to

Keyboard shortcuts

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