Documentation ¶
Index ¶
- Constants
- Variables
- type Mempool
- func (mem *Mempool) Flush()
- func (mem *Mempool) GetPendingMaxNonce(byt []byte) (uint64, error)
- func (mem *Mempool) Lock()
- func (mem *Mempool) Reap(maxTxs int) []types.Tx
- func (mem *Mempool) ReceiveTx(tx types.Tx) (err error)
- func (mem *Mempool) RegisterFilter(filter types.IFilter)
- func (mem *Mempool) Size() int
- func (mem *Mempool) TxsFrontWait() *clist.CElement
- func (mem *Mempool) Unlock()
- func (mem *Mempool) Update(height int64, txs []types.Tx)
- type MempoolMessage
- type MempoolReactor
- func (memR *MempoolReactor) AddPeer(peer *p2p.Peer)
- func (memR *MempoolReactor) GetChannels() []*p2p.ChannelDescriptor
- func (memR *MempoolReactor) Receive(chID byte, src *p2p.Peer, msgBytes []byte)
- func (memR *MempoolReactor) RemovePeer(peer *p2p.Peer, reason interface{})
- func (memR *MempoolReactor) SetEventSwitch(evsw types.EventSwitch)
- type Peer
- type PeerState
- type TxMessage
Constants ¶
View Source
const (
MempoolChannel = byte(0x30)
)
Variables ¶
View Source
var (
ErrTxInCache = errors.New("Tx already exists in cache")
)
Functions ¶
This section is empty.
Types ¶
type Mempool ¶
type Mempool struct {
// contains filtered or unexported fields
}
func NewMempool ¶
func (*Mempool) GetPendingMaxNonce ¶ added in v1.4.3
func (*Mempool) Lock ¶
func (mem *Mempool) Lock()
consensus must be able to hold lock to safely update
func (*Mempool) Reap ¶
Get the valid transactions remaining If maxTxs is -1, there is no cap on returned transactions.
func (*Mempool) ReceiveTx ¶
Try a new transaction in the mempool. Potentially blocking if we're blocking on Update() or Reap(). cb: A callback from the CheckTx command.
It gets called from another goroutine.
CONTRACT: Either cb will get called, or err returned.
func (*Mempool) RegisterFilter ¶
func (*Mempool) TxsFrontWait ¶
func (mem *Mempool) TxsFrontWait() *clist.CElement
Return the first element of mem.txs for peer goroutines to call .NextWait() on. Blocks until txs has elements.
type MempoolMessage ¶
type MempoolMessage interface{}
func DecodeMessage ¶
func DecodeMessage(bz []byte) (msgType byte, msg MempoolMessage, err error)
type MempoolReactor ¶
type MempoolReactor struct { p2p.BaseReactor Mempool types.TxPool // contains filtered or unexported fields }
MempoolReactor handles mempool tx broadcasting amongst peers.
func NewTxReactor ¶
func NewTxReactor(conf *viper.Viper, mempool types.TxPool) *MempoolReactor
func (*MempoolReactor) AddPeer ¶
func (memR *MempoolReactor) AddPeer(peer *p2p.Peer)
Implements Reactor
func (*MempoolReactor) GetChannels ¶
func (memR *MempoolReactor) GetChannels() []*p2p.ChannelDescriptor
Implements Reactor
func (*MempoolReactor) Receive ¶
func (memR *MempoolReactor) Receive(chID byte, src *p2p.Peer, msgBytes []byte)
Implements Reactor
func (*MempoolReactor) RemovePeer ¶
func (memR *MempoolReactor) RemovePeer(peer *p2p.Peer, reason interface{})
Implements Reactor
func (*MempoolReactor) SetEventSwitch ¶
func (memR *MempoolReactor) SetEventSwitch(evsw types.EventSwitch)
implements events.Eventable
Click to show internal directories.
Click to hide internal directories.