Documentation ¶
Index ¶
- type MemPool
- func (m *MemPool) Add(tx transaction.Transaction)
- func (m *MemPool) DeleteByID(txHexID string)
- func (m *MemPool) Get(n int) []transaction.Transaction
- func (m *MemPool) GetByID(txHexID string) (transaction.Transaction, error)
- func (m *MemPool) Read(n int) []transaction.Transaction
- func (m *MemPool) Size() int
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 (*MemPool) Add ¶
func (m *MemPool) Add(tx transaction.Transaction)
Add adds new transaction to the pool
func (*MemPool) DeleteByID ¶
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