Documentation
¶
Index ¶
- Constants
- Variables
- func RemainingHours(hours uint64) uint64
- func RequiredFee(hours uint64) uint64
- func TransactionFee(tx *coin.Transaction, headTime uint64, inUxs coin.UxArray) (uint64, error)
- func VerifyTransactionFee(t *coin.Transaction, fee uint64) error
- func VerifyTransactionFeeForHours(hours, fee uint64) error
Constants ¶
const ( // BurnFactor inverse fraction of coinhours that must be burned BurnFactor uint64 = 2 )
Variables ¶
var ( // ErrTxnNoFee is returned if a transaction has no coinhour fee ErrTxnNoFee = errors.New("Transaction has zero coinhour fee") // ErrTxnInsufficientFee is returned if a transaction's coinhour burn fee is not enough ErrTxnInsufficientFee = errors.New("Transaction coinhour fee minimum not met") // ErrTxnInsufficientCoinHours is returned if a transaction has more coinhours in its outputs than its inputs ErrTxnInsufficientCoinHours = errors.New("Insufficient coinhours for transaction outputs") )
Functions ¶
func RemainingHours ¶
RemainingHours returns the amount of coinhours leftover after paying the fee for the input.
func RequiredFee ¶
RequiredFee returns the coinhours fee required for an amount of hours The required fee is calculated as hours/BurnFactor, rounded up.
func TransactionFee ¶
TransactionFee calculates the current transaction fee in coinhours of a Transaction. Returns ErrTxnInsufficientCoinHours if input hours is less than output hours.
func VerifyTransactionFee ¶
func VerifyTransactionFee(t *coin.Transaction, fee uint64) error
VerifyTransactionFee performs additional transaction verification at the unconfirmed pool level. This checks tunable parameters that should prevent the transaction from entering the blockchain, but cannot be done at the blockchain level because they may be changed.
func VerifyTransactionFeeForHours ¶
VerifyTransactionFeeForHours verifies the fee given fee and hours, where hours is the number of hours in a transaction's outputs, and hours+fee is the number of hours in a transaction's inputs
Types ¶
This section is empty.