Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type TxBuffer ¶
type TxBuffer struct {
// contains filtered or unexported fields
}
TxBuffer is an in-memory data structure containing the set of unconfirmed transactions.
func New ¶
New creates a new instance of the TxBuffer. MaxSize specifies the total number of transactions the TxBuffer may contain.
func (*TxBuffer) Add ¶
func (t *TxBuffer) Add(tx *types.TransactionOrder) ([]byte, error)
Add adds the given transaction to the transaction buffer. Returns an error if the transaction isn't valid, is already present in the TxBuffer, or TxBuffer is full.
type TxHandler ¶
type TxHandler func(ctx context.Context, tx *types.TransactionOrder) bool
TxHandler handles the transaction. Return value should indicate whether the tx was processed successfully (and thus removed from buffer) but currently this value is ignored - after callback returns the tx is always removed from internal buffer.
Click to show internal directories.
Click to hide internal directories.