lps

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2019 License: GPL-3.0, GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package les implements the Light Palletone Subprotocol.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LightFetcher

type LightFetcher 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(getHeaderByHash headerRetrievalFn, lightChainHeight lightChainHeightFn, verifyHeader headerVerifierFn,
	broadcastHeader headerBroadcasterFn, insertHeader headerInsertFn, dropPeer peerDropFn) *LightFetcher

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

func (*LightFetcher) Enqueue

func (f *LightFetcher) Enqueue(peer string, header *modules.Header) error

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

func (*LightFetcher) Start

func (f *LightFetcher) Start()

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

func (*LightFetcher) Stop

func (f *LightFetcher) Stop()

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

Jump to

Keyboard shortcuts

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