Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrCoinsNoSelectionAvailable is returned when a CoinSelector believes there is no possible combination of coins which can meet the requirements provided to the selector. ErrCoinsNoSelectionAvailable = errors.New("no coin selection possible") )
Functions ¶
Types ¶
type CoinSelector ¶
type CoinSet ¶
type CoinSet struct {
// contains filtered or unexported fields
}
func NewCoinSet ¶
NewCoinSet creates a CoinSet containing the coins provided. To create an empty CoinSet, you may pass null as the coins input parameter.
func (*CoinSet) PushCoin ¶
PushCoin adds a coin to the end of the list and updates the cached value amounts.
func (*CoinSet) TotalValue ¶
TotalValue returns the total value of the coins in the set.
func (*CoinSet) TotalValueAge ¶
TotalValueAge returns the total value * number of confirmations of the coins in the set.
type MaxValueAgeCoinSelector ¶
func (MaxValueAgeCoinSelector) CoinSelect ¶
CoinSelect will attempt to select coins using the algorithm described in the MaxValueAgeCoinSelector struct.
type MinIndexCoinSelector ¶
func (MinIndexCoinSelector) CoinSelect ¶
CoinSelect will attempt to select coins using the algorithm described in the MinIndexCoinSelector struct.
type MinNumberCoinSelector ¶
func (MinNumberCoinSelector) CoinSelect ¶
CoinSelect will attempt to select coins using the algorithm described in the MinNumberCoinSelector struct.
type MinPriorityCoinSelector ¶
type MinPriorityCoinSelector struct { MaxInputs int MinChangeAmount util.Amount MinAvgValueAgePerInput int64 }
func (MinPriorityCoinSelector) CoinSelect ¶
CoinSelect will attempt to select coins using the algorithm described in the MinPriorityCoinSelector struct.
type SimpleCoin ¶
func (*SimpleCoin) Hash ¶
func (c *SimpleCoin) Hash() *chainhash.Hash
Hash returns the hash value of the transaction on which the Coin is an output
func (*SimpleCoin) Index ¶
func (c *SimpleCoin) Index() uint32
Index returns the index of the output on the transaction which the Coin represents
func (*SimpleCoin) NumConfs ¶
func (c *SimpleCoin) NumConfs() int64
NumConfs returns the number of confirmations that the transaction the Coin references has had.
func (*SimpleCoin) PkScript ¶
func (c *SimpleCoin) PkScript() []byte
PkScript returns the outpoint script of the Coin. This can be used to determine what type of script the Coin uses and extract standard addresses if possible using txscript.ExtractPkScriptAddrs for example.
func (*SimpleCoin) Value ¶
func (c *SimpleCoin) Value() util.Amount
Value returns the value of the Coin
func (*SimpleCoin) ValueAge ¶
func (c *SimpleCoin) ValueAge() int64
ValueAge returns the product of the value and the number of confirmations. This is used as an input to calculate the priority of the transaction.