Documentation
¶
Index ¶
Constants ¶
View Source
const (
DefaultBlockPrioritySize = 12345
)
Basic constant settings for TxPool
Variables ¶
This section is empty.
Functions ¶
func IsFullySpent ¶
func IsFullySpent(outputs []*blockchain.TxOutput) bool
IsFullySpent Check whether the output txs have been fully spent
Types ¶
type TxDesc ¶
type TxDesc struct {
Tx *blockchain.Tx
AddedTime time.Time
BlockHeight uint32
Fee int64
FeePerKB int64
Priority float64
// contains filtered or unexported fields
}
TxDesc contains Transaction with misc
type TxPool ¶
type TxPool interface {
// RemoveOrphanTx remove an orphan transaction, but not its descendants
RemoveOrphanTx(tx *blockchain.Tx)
// RemoveOrphanTxsByTag remove all the orphan transactions with tag
RemoveOrphanTxsByTag(tag Tag) uint64
// HasOrphanTx check whether hash is an orphan transaction in the pool
HasOrphanTx(hash cp.Hash32B) bool
// HasTxOrOrphanTx check whether hash is an accepted or orphan transaction in the pool
HasTxOrOrphanTx(hash cp.Hash32B) bool
// RemoveTx remove an accepted transaction
RemoveTx(tx *blockchain.Tx, removeDescendants bool)
// RemoveDoubleSpends remove the double spending transaction
RemoveDoubleSpends(tx *blockchain.Tx)
// FetchTx fetch accepted transaction from the pool
FetchTx(hash *cp.Hash32B) (*blockchain.Tx, error)
// MaybeAcceptTx add Tx into pool if it could be accpted
MaybeAcceptTx(tx *blockchain.Tx, isNew bool, rateLimit bool) ([]cp.Hash32B, *TxDesc, error)
// ProcessOrphanTxs process the orphan txs depending on the accepted tx
ProcessOrphanTxs(acceptedTx *blockchain.Tx) []*TxDesc
// ProcessTx process the tx
ProcessTx(tx *blockchain.Tx, allowOrphan bool, rateLimit bool, tag Tag) ([]*TxDesc, error)
// TxDescs return all the transaction descs
TxDescs() []*TxDesc
// Txs return all Transactions
Txs() []*blockchain.Tx
// RemoveTxInBlock remove all transactions in a block
RemoveTxInBlock(block *blockchain.Block) error
// LastTimePoolUpdated get the last time the pool got updated
LastTimePoolUpdated() time.Time
}
TxPool is a pool of received txs
type TxSourcePointer ¶
TxSourcePointer is to refer to the output tx, hash + index in the output tx
func NewTxSourcePointer ¶
func NewTxSourcePointer(in *blockchain.TxInput) TxSourcePointer
NewTxSourcePointer creates a new TxSourcePointer given TxInput
Click to show internal directories.
Click to hide internal directories.