peermsg

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetBlocks

type GetBlocks struct {
	Locators [][]byte
}

GetBlocks defines a getblocks message on the Dusk wire protocol. It is used to request blocks from another peer.

func (*GetBlocks) Decode

func (g *GetBlocks) Decode(r *bytes.Buffer) error

Decode a GetBlocks struct from r into g.

func (*GetBlocks) Encode

func (g *GetBlocks) Encode(w *bytes.Buffer) error

Encode a GetBlocks struct and write it to w.

type Inv

type Inv struct {
	InvList []InvVect
}

Inv contains a list of Inventory vector

func (*Inv) AddItem

func (inv *Inv) AddItem(t InvType, hash []byte)

AddItem to an Inventory

func (*Inv) Decode

func (inv *Inv) Decode(r *bytes.Buffer) error

Decode an Inventory from a buffer

func (*Inv) Encode

func (inv *Inv) Encode(w *bytes.Buffer) error

Encode an Inventory request into a buffer

type InvType

type InvType uint8

InvType is a byte describing the Inventory type

var (
	//InvTypeMempoolTx is the inventory type for unconfirmed Txs
	InvTypeMempoolTx InvType = 0
	// InvTypeBlock is the inventory type for confirmed Txs
	InvTypeBlock InvType = 1
)

type InvVect

type InvVect struct {
	Type InvType // Type of data
	Hash []byte  // Hash of the data
}

InvVect represents a request of sort for Inventory data

Jump to

Keyboard shortcuts

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