mempool

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: ISC Imports: 18 Imported by: 7

Documentation

Index

Constants

View Source
const (

	// MaximumStandardTransactionMass is the maximum mass allowed for transactions that
	// are considered standard and will therefore be relayed and considered for mining.
	MaximumStandardTransactionMass = 100_000
)

Variables

This section is empty.

Functions

func New

New constructs a new mempool

Types

type Config

type Config struct {
	MaximumTransactionCount               uint64
	TransactionExpireIntervalDAAScore     uint64
	TransactionExpireScanIntervalDAAScore uint64
	TransactionExpireScanIntervalSeconds  uint64
	OrphanExpireIntervalDAAScore          uint64
	OrphanExpireScanIntervalDAAScore      uint64
	MaximumOrphanTransactionMass          uint64
	MaximumOrphanTransactionCount         uint64
	AcceptNonStandard                     bool
	MaximumMassPerBlock                   uint64
	MinimumRelayTransactionFee            util.Amount
	MinimumStandardTransactionVersion     uint16
	MaximumStandardTransactionVersion     uint16
}

Config represents a mempool configuration

func DefaultConfig

func DefaultConfig(dagParams *dagconfig.Params) *Config

DefaultConfig returns the default mempool configuration

type RejectCode

type RejectCode uint8

RejectCode represents a numeric value by which a remote peer indicates why a message was rejected.

const (
	RejectMalformed       RejectCode = 0x01
	RejectInvalid         RejectCode = 0x10
	RejectObsolete        RejectCode = 0x11
	RejectDuplicate       RejectCode = 0x12
	RejectNotRequested    RejectCode = 0x13
	RejectNonstandard     RejectCode = 0x40
	RejectDust            RejectCode = 0x41
	RejectInsufficientFee RejectCode = 0x42
	RejectFinality        RejectCode = 0x43
	RejectDifficulty      RejectCode = 0x44
	RejectImmatureSpend   RejectCode = 0x45
	RejectBadOrphan       RejectCode = 0x64
	RejectSpamTx          RejectCode = 0x65
)

These constants define the various supported reject codes.

func (RejectCode) String

func (code RejectCode) String() string

String returns the RejectCode in human-readable form.

type RuleError

type RuleError struct {
	Err error
}

RuleError identifies a rule violation. It is used to indicate that processing of a transaction failed due to one of the many validation rules. The caller can use type assertions to determine if a failure was specifically due to a rule violation and use the Err field to access the underlying error, which will be either a TxRuleError or a ruleerrors.RuleError.

func (RuleError) Error

func (e RuleError) Error() string

Error satisfies the error interface and prints human-readable errors.

func (RuleError) Unwrap

func (e RuleError) Unwrap() error

Unwrap unwraps the wrapped error

type TxRuleError

type TxRuleError struct {
	RejectCode  RejectCode // The code to send with reject messages
	Description string     // Human readable description of the issue
}

TxRuleError identifies a rule violation. It is used to indicate that processing of a transaction failed due to one of the many validation rules. The caller can use type assertions to determine if a failure was specifically due to a rule violation and access the ErrorCode field to ascertain the specific reason for the rule violation.

func (TxRuleError) Error

func (e TxRuleError) Error() string

Error satisfies the error interface and prints human-readable errors.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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