network

package
v0.0.0-...-6b2095d Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Nodes []*Node

computers that bitcoin

View Source
var Peers []*Peer

peers that we connected to

View Source
var ProtocolVersion = 70013

Functions

func NewNode

func NewNode(address []byte, port int)

func Start

func Start()

Types

type Node

type Node struct {
	Address net.IP
	Port    int
	Status  int // node status codes:
	// 0 - not contacted yet
	// 1 - connected, bash a Peer instance
	// 2 - connection was attempted
	Peer *Peer
}

type Peer

type Peer struct {
	Alive bool
	Conn  net.Conn
	// contains filtered or unexported fields
}

func (*Peer) GetBlocks

func (p *Peer) GetBlocks(blocks [][32]byte) error

func (*Peer) SendGetHeaders

func (p *Peer) SendGetHeaders(start [32]byte, end [32]byte)

func (*Peer) Start

func (p *Peer) Start()

Jump to

Keyboard shortcuts

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