types

package
v0.2.15-beta.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 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 {
	Tid       types.TransactionID
	Principal types.Address
	Fee       uint64 // TODO replace with gas price
	MaxGas    uint64
	Received  time.Time

	Amount uint64
	Nonce  uint64
	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) 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