chainsync

package
v0.30.3 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Batch

type Batch struct {
	BlockIDs []flow.Identifier
}

Batch is a set of block IDs we want to request.

type Range

type Range struct {
	From uint64
	To   uint64
}

Range is a height range for which we want to request blocks. inclusive [from, to]

func (*Range) Len

func (r *Range) Len() int

type Status

type Status struct {
	BlockHeight uint64       // always present even if we haven't received the header
	Queued      time.Time    // when we originally queued this block request
	Requested   time.Time    // the last time we requested this block
	Attempts    uint         // how many times we've requested this block
	Header      *flow.Header // the requested header, if we've received it
	Received    time.Time    // when we received a response
}

Status keeps track of a block download status.

func NewQueuedStatus

func NewQueuedStatus(height uint64) *Status

func (*Status) StatusString

func (s *Status) StatusString() string

func (*Status) WasQueued

func (s *Status) WasQueued() bool

func (*Status) WasReceived

func (s *Status) WasReceived() bool

func (*Status) WasRequested

func (s *Status) WasRequested() bool

Jump to

Keyboard shortcuts

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