go-ethereum: github.com/axiomzen/go-ethereum/eth/fetcher Index | Files

package fetcher

import "github.com/axiomzen/go-ethereum/eth/fetcher"

Package fetcher contains the block announcement based synchronisation.

Index

Package Files

fetcher.go metrics.go

type Fetcher Uses

type Fetcher struct {
    // contains filtered or unexported fields
}

Fetcher is responsible for accumulating block announcements from various peers and scheduling them for retrieval.

func New Uses

func New(getBlock blockRetrievalFn, verifyHeader headerVerifierFn, broadcastBlock blockBroadcasterFn, chainHeight chainHeightFn, insertChain chainInsertFn, dropPeer peerDropFn) *Fetcher

New creates a block fetcher to retrieve blocks based on hash announcements.

func (*Fetcher) Enqueue Uses

func (f *Fetcher) Enqueue(peer string, block *types.Block) error

Enqueue tries to fill gaps the fetcher's future import queue.

func (*Fetcher) FilterBodies Uses

func (f *Fetcher) FilterBodies(peer string, transactions [][]*types.Transaction, uncles [][]*types.Header, time time.Time) ([][]*types.Transaction, [][]*types.Header)

FilterBodies extracts all the block bodies that were explicitly requested by the fetcher, returning those that should be handled differently.

func (*Fetcher) FilterHeaders Uses

func (f *Fetcher) FilterHeaders(peer string, headers []*types.Header, time time.Time) []*types.Header

FilterHeaders extracts all the headers that were explicitly requested by the fetcher, returning those that should be handled differently.

func (*Fetcher) Notify Uses

func (f *Fetcher) Notify(peer string, hash common.Hash, number uint64, time time.Time,
    headerFetcher headerRequesterFn, bodyFetcher bodyRequesterFn) error

Notify announces the fetcher of the potential availability of a new block in the network.

func (*Fetcher) Start Uses

func (f *Fetcher) Start()

Start boots up the announcement based synchroniser, accepting and processing hash notifications and block fetches until termination requested.

func (*Fetcher) Stop Uses

func (f *Fetcher) Stop()

Stop terminates the announcement based synchroniser, canceling all pending operations.

Package fetcher imports 9 packages (graph). Updated 2019-07-06. Refresh now. Tools for package owners.