fetcher

package
v0.0.0-...-7de8d3f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2019 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package fetcher contains the block announcement based synchronisation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fetcher

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

func New(name string, 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

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

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

func (*Fetcher) Notify

func (f *Fetcher) Notify(peer IPeer, hash common.Hash, number uint64,
	headerFetcher headerRequesterFn, bodyFetcher bodyRequesterFn)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL