transactionrelay

package
v0.0.0-...-30b4086 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: ISC Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleRelayedTransactions

func HandleRelayedTransactions(context TransactionsRelayContext, incomingRoute *router.Route, outgoingRoute *router.Route) error

HandleRelayedTransactions listens to appmessage.MsgInvTransaction messages, requests their corresponding transactions if they are missing, adds them to the mempool and propagates them to the rest of the network.

func HandleRequestedTransactions

func HandleRequestedTransactions(context TransactionsRelayContext, incomingRoute *router.Route, outgoingRoute *router.Route) error

HandleRequestedTransactions listens to appmessage.MsgRequestTransactions messages, responding with the requested transactions if those are in the mempool. Missing transactions would be ignored

Types

type TransactionsRelayContext

type TransactionsRelayContext interface {
	NetAdapter() *netadapter.NetAdapter
	Domain() domain.Domain
	SharedRequestedTransactions() *flowcontext.SharedRequestedTransactions
	OnTransactionAddedToMempool()
	EnqueueTransactionIDsForPropagation(transactionIDs []*externalapi.DomainTransactionID) error
	IsNearlySynced() (bool, error)
}

TransactionsRelayContext is the interface for the context needed for the HandleRelayedTransactions and HandleRequestedTransactions flows.

Jump to

Keyboard shortcuts

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