bchwallet: github.com/gcash/bchwallet/wallet/txrules Index | Files

package txrules

import "github.com/gcash/bchwallet/wallet/txrules"

Package txrules provides transaction rules that should be followed by transaction authors for wide mempool acceptance and quick mining.

Index

Package Files

rules.go

Constants

const DefaultRelayFeePerKb bchutil.Amount = 1e3

DefaultRelayFeePerKb is the default minimum relay fee policy for a mempool.

Variables

var (
    ErrAmountNegative   = errors.New("transaction output amount is negative")
    ErrAmountExceedsMax = errors.New("transaction output amount exceeds maximum value")
    ErrOutputIsDust     = errors.New("transaction output is dust")
)

Transaction rule violations

func CheckOutput Uses

func CheckOutput(output *wire.TxOut, relayFeePerKb bchutil.Amount) error

CheckOutput performs simple consensus and policy tests on a transaction output.

func FeeForSerializeSize Uses

func FeeForSerializeSize(relayFeePerKb bchutil.Amount, txSerializeSize int) bchutil.Amount

FeeForSerializeSize calculates the required fee for a transaction of some arbitrary size given a mempool's relay fee policy.

func GetDustThreshold Uses

func GetDustThreshold(scriptSize int, relayFeePerKb bchutil.Amount) bchutil.Amount

GetDustThreshold is used to define the amount below which output will be determined as dust. Threshold is determined as 3 times the relay fee.

func IsDustAmount Uses

func IsDustAmount(amount bchutil.Amount, scriptSize int, relayFeePerKb bchutil.Amount) bool

IsDustAmount determines whether a transaction output value and script length would cause the output to be considered dust. Transactions with dust outputs are not standard and are rejected by mempools with default policies.

func IsDustOutput Uses

func IsDustOutput(output *wire.TxOut, relayFeePerKb bchutil.Amount) bool

IsDustOutput determines whether a transaction output is considered dust. Transactions with dust outputs are not standard and are rejected by mempools with default policies.

Package txrules imports 4 packages (graph) and is imported by 3 packages. Updated 2018-10-08. Refresh now. Tools for package owners.