candidate

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SanityCheckCandidate added in v0.6.0

func SanityCheckCandidate(cm block.Block) error

SanityCheckCandidate makes sure the hash is correct, to avoid malicious nodes from overwriting the candidate block for a specific hash.

func Validate added in v0.3.0

func Validate(m message.Message) error

Validate an incoming Candidate message.

Types

type Requestor added in v0.4.0

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

Requestor serves to retrieve certain Candidate messages from peers in the network.

func NewRequestor added in v0.4.0

func NewRequestor(publisher eventbus.Publisher) *Requestor

NewRequestor returns an initialized Requestor struct.

func (*Requestor) ProcessCandidate added in v0.4.0

func (r *Requestor) ProcessCandidate(srcPeerID string, msg message.Message) ([]bytes.Buffer, error)

ProcessCandidate will process a received Candidate message. Invalid and non-matching Candidate messages are discarded.

func (*Requestor) RequestCandidate added in v0.4.0

func (r *Requestor) RequestCandidate(ctx context.Context, hash []byte) (block.Block, error)

RequestCandidate will attempt to fetch a Candidate message for a given hash from the network.

Jump to

Keyboard shortcuts

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