messages

package
v0.0.0-...-d596c11 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockMessage

type BlockMessage struct {
	Block *block.Block
}

type InvMessage

type InvMessage struct {
	Inventory []InvVector
}

type InvType

type InvType uint8
const (
	InvTypeBlock InvType = iota
	InvTypeTx
)

type InvVector

type InvVector struct {
	Type InvType
	Hash []byte
}

type Message

type Message struct {
	Type    MessageType
	Payload interface{}
}

func NewBlockMessage

func NewBlockMessage(block *block.Block) *Message

func NewInvMessage

func NewInvMessage(invType InvType, hashes [][]byte) *Message

func NewMessage

func NewMessage(msgType MessageType, payload interface{}) *Message

func NewTransactionMessage

func NewTransactionMessage(tx *core.Transaction) *Message

type MessageType

type MessageType uint8
const (
	MsgTypeBlock MessageType = iota
	MsgTypeTx
	MsgTypeGetBlocks
	MsgTypeGetData
	MsgTypeInv
	MsgTypePing
	MsgTypePong
)

type TransactionMessage

type TransactionMessage struct {
	Transaction *core.Transaction
}

Jump to

Keyboard shortcuts

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