updater

package
v0.0.0-...-48e51da Latest Latest
Warning

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

Go to latest
Published: May 14, 2019 License: ISC Imports: 12 Imported by: 0

Documentation

Overview

Package updater implements the Fonero updater.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisableLog

func DisableLog()

DisableLog disables all library log output. Logging output is disabled by default until either UseLogger or SetLogWriter are called.

func Head(net wire.CurrencyNet) (*[32]byte, error)

Head returns the current hashchain head for the given net.

func SplitMsgInv

func SplitMsgInv(msg *wire.MsgInv) (*wire.MsgInv, *wire.MsgInv, error)

SplitMsgInv splits an inventory message into non-updater and updater inventory messages.

func UseLogger

func UseLogger(logger slog.Logger)

UseLogger uses a specified Logger to output package logging info. This should be used in preference to SetLogWriter if the caller is also using slog.

Types

type UpdateManager

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

UpdateManager provides a concurrency safe update manager for handling all incoming Codechain entries and patch files.

func NewUpdateManager

func NewUpdateManager(maxPeers int, treeHash, dataDir string) (*UpdateManager, error)

NewUpdateManager returns a new Fonero update manager. Use Start to begin processing asynchronous update inv updates.

func (*UpdateManager) QueueInv

func (u *UpdateManager) QueueInv(inv *wire.MsgInv, p *peer.Peer)

QueueInv adds the passed inv message and peer to the update handling queue.

func (*UpdateManager) Start

func (u *UpdateManager) Start()

Start begins the core update handler which processes Codechain entry and patch file inv messages.

func (*UpdateManager) Stop

func (u *UpdateManager) Stop() error

Stop gracefully shuts down the update manager by stopping all asynchronous handlers and waiting for them to finish.

Directories

Path Synopsis
internal
chainstate
Package chainstate implements the hashchain state for the Fonero updater.
Package chainstate implements the hashchain state for the Fonero updater.

Jump to

Keyboard shortcuts

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