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 SharedRequestedTransactions ¶
type SharedRequestedTransactions struct { // contains filtered or unexported fields }
SharedRequestedTransactions is a data structure that is shared between peers that holds the IDs of all the requested transactions to prevent redundant requests.
func NewSharedRequestedTransactions ¶
func NewSharedRequestedTransactions() *SharedRequestedTransactions
NewSharedRequestedTransactions returns a new instance of SharedRequestedTransactions.
type TransactionsRelayContext ¶
type TransactionsRelayContext interface { NetAdapter() *netadapter.NetAdapter Domain() domain.Domain OnTransactionAddedToMempool() EnqueueTransactionIDsForPropagation(transactionIDs []*externalapi.DomainTransactionID) error }
TransactionsRelayContext is the interface for the context needed for the HandleRelayedTransactions and HandleRequestedTransactions flows.