Documentation ¶
Index ¶
- Variables
- type Mempool
- func (mem *Mempool) AddTx(tx types.Tx) (err error)
- func (mem *Mempool) GetCache() *sm.BlockCache
- func (mem *Mempool) GetHeight() int
- func (mem *Mempool) GetProposalTxs() []types.Tx
- func (mem *Mempool) GetState() *sm.State
- func (mem *Mempool) ResetForBlockAndState(block *types.Block, state *sm.State) ResetInfo
- type MempoolMessage
- type MempoolReactor
- func (memR *MempoolReactor) AddPeer(peer *p2p.Peer)
- func (memR *MempoolReactor) BroadcastTx(tx types.Tx) error
- 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) ResetForBlockAndState(block *types.Block, state *sm.State)
- func (memR *MempoolReactor) SetFireable(evsw events.Fireable)
- type Peer
- type PeerState
- type Range
- type ResetInfo
- type TxMessage
Constants ¶
This section is empty.
Variables ¶
var (
MempoolChannel = byte(0x30)
)
Functions ¶
This section is empty.
Types ¶
type Mempool ¶
type Mempool struct {
// contains filtered or unexported fields
}
func NewMempool ¶
func (*Mempool) GetCache ¶
func (mem *Mempool) GetCache() *sm.BlockCache
func (*Mempool) GetProposalTxs ¶
func (*Mempool) ResetForBlockAndState ¶
"block" is the new block being committed. "state" is the result of state.AppendBlock("block"). Txs that are present in "block" are discarded from mempool. Txs that have become invalid in the new "state" are also discarded.
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 *Mempool // contains filtered or unexported fields }
MempoolReactor handles mempool tx broadcasting amongst peers.
func NewMempoolReactor ¶
func NewMempoolReactor(mempool *Mempool) *MempoolReactor
func (*MempoolReactor) AddPeer ¶
func (memR *MempoolReactor) AddPeer(peer *p2p.Peer)
Implements Reactor
func (*MempoolReactor) BroadcastTx ¶
func (memR *MempoolReactor) BroadcastTx(tx types.Tx) error
Just an alias for AddTx since broadcasting happens in peer routines
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) ResetForBlockAndState ¶
func (memR *MempoolReactor) ResetForBlockAndState(block *types.Block, state *sm.State)
"block" is the new block being committed. "state" is the result of state.AppendBlock("block"). Txs that are present in "block" are discarded from mempool. Txs that have become invalid in the new "state" are also discarded.
func (*MempoolReactor) SetFireable ¶
func (memR *MempoolReactor) SetFireable(evsw events.Fireable)
implements events.Eventable