model

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: ISC Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTransactionNotFound = errors.New("Couldn't find transaction in mp.orderedTransactionsByFeeRate")

ErrTransactionNotFound is returned bt tobf.TransactionsOrderedByFeeRate

Functions

This section is empty.

Types

type IDToTransactionMap

type IDToTransactionMap map[externalapi.DomainTransactionID]*MempoolTransaction

IDToTransactionMap maps transactionID to a MempoolTransaction

type IDToTransactionsSliceMap

type IDToTransactionsSliceMap map[externalapi.DomainTransactionID][]*MempoolTransaction

IDToTransactionsSliceMap maps transactionID to a slice MempoolTransaction

type MempoolTransaction

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

MempoolTransaction represents a transaction inside the main TransactionPool

func NewMempoolTransaction

func NewMempoolTransaction(
	transaction *externalapi.DomainTransaction,
	parentTransactionsInPool IDToTransactionMap,
	isHighPriority bool,
	addedAtDAAScore uint64,
) *MempoolTransaction

NewMempoolTransaction constructs a new MempoolTransaction

func (*MempoolTransaction) AddedAtDAAScore

func (mt *MempoolTransaction) AddedAtDAAScore() uint64

AddedAtDAAScore returns the virtual DAA score at which this MempoolTransaction was added to the mempool

func (*MempoolTransaction) IsHighPriority

func (mt *MempoolTransaction) IsHighPriority() bool

IsHighPriority returns whether this MempoolTransaction is a high-priority one

func (*MempoolTransaction) ParentTransactionsInPool

func (mt *MempoolTransaction) ParentTransactionsInPool() IDToTransactionMap

ParentTransactionsInPool a list of parent transactions that exist in the mempool, indexed by outpoint

func (*MempoolTransaction) RemoveParentTransactionInPool

func (mt *MempoolTransaction) RemoveParentTransactionInPool(transactionID *externalapi.DomainTransactionID)

RemoveParentTransactionInPool deletes a transaction from the parentTransactionsInPool set

func (*MempoolTransaction) Transaction

Transaction return the DomainTransaction associated with this MempoolTransaction:

func (*MempoolTransaction) TransactionID

func (mt *MempoolTransaction) TransactionID() *externalapi.DomainTransactionID

TransactionID returns the ID of this MempoolTransaction

type OrphanTransaction

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

OrphanTransaction represents a transaction in the OrphanPool

func NewOrphanTransaction

func NewOrphanTransaction(
	transaction *externalapi.DomainTransaction,
	isHighPriority bool,
	addedAtDAAScore uint64,
) *OrphanTransaction

NewOrphanTransaction constructs a new OrphanTransaction

func (*OrphanTransaction) AddedAtDAAScore

func (ot *OrphanTransaction) AddedAtDAAScore() uint64

AddedAtDAAScore returns the virtual DAA score at which this OrphanTransaction was added to the mempool

func (*OrphanTransaction) IsHighPriority

func (ot *OrphanTransaction) IsHighPriority() bool

IsHighPriority returns whether this OrphanTransaction is a high-priority one

func (*OrphanTransaction) Transaction

func (ot *OrphanTransaction) Transaction() *externalapi.DomainTransaction

Transaction return the DomainTransaction associated with this OrphanTransaction:

func (*OrphanTransaction) TransactionID

func (ot *OrphanTransaction) TransactionID() *externalapi.DomainTransactionID

TransactionID returns the ID of this OrphanTransaction

type OutpointToTransactionMap

type OutpointToTransactionMap map[externalapi.DomainOutpoint]*MempoolTransaction

OutpointToTransactionMap maps an outpoint to a MempoolTransaction

type OutpointToUTXOEntryMap

type OutpointToUTXOEntryMap map[externalapi.DomainOutpoint]externalapi.UTXOEntry

OutpointToUTXOEntryMap maps an outpoint to a UTXOEntry

type ScriptPublicKeyStringToDomainTransaction

type ScriptPublicKeyStringToDomainTransaction map[string]*externalapi.DomainTransaction

ScriptPublicKeyStringToDomainTransaction maps an outpoint to a DomainTransaction

type Transaction

type Transaction interface {
	TransactionID() *externalapi.DomainTransactionID
	Transaction() *externalapi.DomainTransaction
}

Transaction represents a generic transaction either in the mempool's main TransactionPool or OrphanPool

type TransactionsOrderedByFeeRate

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

TransactionsOrderedByFeeRate represents a set of MempoolTransactions ordered by their fee / mass rate

func (*TransactionsOrderedByFeeRate) GetByIndex

func (tobf *TransactionsOrderedByFeeRate) GetByIndex(index int) *MempoolTransaction

GetByIndex returns the transaction in the given index

func (*TransactionsOrderedByFeeRate) Push

func (tobf *TransactionsOrderedByFeeRate) Push(transaction *MempoolTransaction) error

Push inserts a transaction into the set, placing it in the correct place to preserve order

func (*TransactionsOrderedByFeeRate) Remove

func (tobf *TransactionsOrderedByFeeRate) Remove(transaction *MempoolTransaction) error

Remove removes the given transaction from the set. Returns an error if transaction does not exist in the set, or if the given transaction does not have mass and fee filled in.

func (*TransactionsOrderedByFeeRate) RemoveAtIndex

func (tobf *TransactionsOrderedByFeeRate) RemoveAtIndex(index int) error

RemoveAtIndex removes the transaction at the given index. Returns an error in case of out-of-bounds index.

Jump to

Keyboard shortcuts

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