Documentation ¶
Index ¶
- Constants
- Variables
- func ValidateMsg(pb proto.Message) error
- type BlockPool
- func (pool *BlockPool) AddBlock(peerID p2p.ID, block *types.Block, blockSize int)
- func (pool *BlockPool) GetStatus() (height int64, numPending int32, lenRequesters int)
- func (pool *BlockPool) IsCaughtUp() bool
- func (pool *BlockPool) MaxPeerHeight() int64
- func (pool *BlockPool) OnStart() error
- func (pool *BlockPool) PeekTwoBlocks() (first *types.Block, second *types.Block)
- func (pool *BlockPool) PopRequest()
- func (pool *BlockPool) RedoRequest(height int64) p2p.ID
- func (pool *BlockPool) RemovePeer(peerID p2p.ID)
- func (pool *BlockPool) SetPeerRange(peerID p2p.ID, base int64, height int64)
- type BlockRequest
- type Reactor
- func (bcR *Reactor) AddPeer(peer p2p.Peer)
- func (bcR *Reactor) BroadcastStatusRequest()
- func (bcR *Reactor) GetChannels() []*p2p.ChannelDescriptor
- func (bcR *Reactor) OnStart() error
- func (bcR *Reactor) OnStop()
- func (bcR *Reactor) ReceiveEnvelope(e p2p.Envelope)
- func (bcR *Reactor) RemovePeer(peer p2p.Peer, reason interface{})
- func (bcR *Reactor) SetLogger(l log.Logger)
- func (bcR *Reactor) SwitchToBlockSync(state sm.State) error
Constants ¶
View Source
const ( BlockResponseMessagePrefixSize = 4 BlockResponseMessageFieldKeySize = 1 MaxMsgSize = types.MaxBlockSizeBytes + BlockResponseMessagePrefixSize + BlockResponseMessageFieldKeySize )
View Source
const (
BlocksyncChannel = byte(0x40)
)
Variables ¶
Functions ¶
func ValidateMsg ¶
Types ¶
type BlockPool ¶
type BlockPool struct { service.BaseService // contains filtered or unexported fields }
func NewBlockPool ¶
func NewBlockPool(start int64, requestsCh chan<- BlockRequest, errorsCh chan<- peerError) *BlockPool
func (*BlockPool) IsCaughtUp ¶
func (*BlockPool) MaxPeerHeight ¶
func (*BlockPool) PeekTwoBlocks ¶
func (*BlockPool) PopRequest ¶
func (pool *BlockPool) PopRequest()
func (*BlockPool) RemovePeer ¶
type BlockRequest ¶
type Reactor ¶
type Reactor struct { p2p.BaseReactor // contains filtered or unexported fields }
func NewReactor ¶
func NewReactor(state sm.State, blockExec *sm.BlockExecutor, store *store.BlockStore, blockSync bool) *Reactor
func (*Reactor) BroadcastStatusRequest ¶
func (bcR *Reactor) BroadcastStatusRequest()
func (*Reactor) GetChannels ¶
func (bcR *Reactor) GetChannels() []*p2p.ChannelDescriptor
func (*Reactor) ReceiveEnvelope ¶
func (*Reactor) RemovePeer ¶
Click to show internal directories.
Click to hide internal directories.