types

package
v0.2.20-beta.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NanoTX

type NanoTX struct {
	types.TxHeader
	ID types.TransactionID

	Received time.Time

	Block types.BlockID
	Layer types.LayerID
}

NanoTX represents minimal info about a transaction for the conservative cache/mempool.

func NewNanoTX

func NewNanoTX(mtx *types.MeshTransaction) *NanoTX

NewNanoTX converts a NanoTX instance from a MeshTransaction.

func (*NanoTX) Better

func (n *NanoTX) Better(other *NanoTX, blockSeed []byte) bool

Better returns true if this transaction takes priority than `other`. when the block seed is non-empty, this tx is being considered for a block. the block seed then is used to tie-break (deterministically) transactions for the same account/nonce.

func (*NanoTX) MaxSpending

func (n *NanoTX) MaxSpending() uint64

MaxSpending returns the maximal amount a transaction can spend.

func (*NanoTX) UpdateLayer

func (n *NanoTX) UpdateLayer(lid types.LayerID, bid types.BlockID)

UpdateLayer updates the layer of a transaction.

func (*NanoTX) UpdateLayerMaybe

func (n *NanoTX) UpdateLayerMaybe(lid types.LayerID, bid types.BlockID)

UpdateLayerMaybe updates the layer of a transaction if it's lower than the current value.

Jump to

Keyboard shortcuts

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