Documentation ¶
Index ¶
- Constants
- type BodyDownload
- func (bd *BodyDownload) DeliverBodies(bodies []*types.Body) (int, int)
- func (bd *BodyDownload) DeliveryCounts() (float64, float64)
- func (bd *BodyDownload) DeliverySize(delivered float64, wasted float64)
- func (bd *BodyDownload) GetDeliveries() []*types.Block
- func (bd *BodyDownload) GetPenaltyPeers() [][]byte
- func (bd *BodyDownload) PrintPeerMap()
- func (bd *BodyDownload) RequestMoreBodies(db ethdb.Database, blockNum uint64, currentTime uint64) (*BodyRequest, uint64)
- func (bd *BodyDownload) RequestSent(bodyReq *BodyRequest, timeWithTimeout uint64, peer []byte)
- func (bd *BodyDownload) UpdateFromDb(db ethdb.Database) (headHeight uint64, headHash common.Hash, headTd *big.Int, err error)
- type BodyRequest
- type DoubleHash
Constants ¶
View Source
const BlockBufferSize = 1024
View Source
const MaxBodiesInRequest = 1024
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BodyDownload ¶
type BodyDownload struct {
// contains filtered or unexported fields
}
BodyDownload represents the state of body downloading process
func NewBodyDownload ¶
func NewBodyDownload(outstandingLimit int) *BodyDownload
NewBodyDownload create a new body download state object
func (*BodyDownload) DeliverBodies ¶
func (bd *BodyDownload) DeliverBodies(bodies []*types.Body) (int, int)
DeliverBody takes the block body received from a peer and adds it to the various data structures
func (*BodyDownload) DeliveryCounts ¶
func (bd *BodyDownload) DeliveryCounts() (float64, float64)
func (*BodyDownload) DeliverySize ¶
func (bd *BodyDownload) DeliverySize(delivered float64, wasted float64)
func (*BodyDownload) GetDeliveries ¶
func (bd *BodyDownload) GetDeliveries() []*types.Block
func (*BodyDownload) GetPenaltyPeers ¶
func (bd *BodyDownload) GetPenaltyPeers() [][]byte
func (*BodyDownload) PrintPeerMap ¶
func (bd *BodyDownload) PrintPeerMap()
func (*BodyDownload) RequestMoreBodies ¶
func (bd *BodyDownload) RequestMoreBodies(db ethdb.Database, blockNum uint64, currentTime uint64) (*BodyRequest, uint64)
func (*BodyDownload) RequestSent ¶
func (bd *BodyDownload) RequestSent(bodyReq *BodyRequest, timeWithTimeout uint64, peer []byte)
type BodyRequest ¶
type BodyRequest struct { BlockNums []uint64 Hashes []common.Hash // contains filtered or unexported fields }
BodyRequest is a sketch of the request for block bodies, meaning that access to the database is required to convert it to the actual BlockBodies request (look up hashes of canonical blocks)
type DoubleHash ¶
type DoubleHash [2 * common.HashLength]byte
DoubleHash is type to be used for the mapping between TxHash and UncleHash to the block header
Click to show internal directories.
Click to hide internal directories.