csn

package
v0.0.0-...-77c8a84 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PushTx

func PushTx(tx *wire.MsgTx) error

TODO implement. I guess push to the bridge node. But really it'd be better to just push it out to the regular p2p network.

func RunIBD

func RunIBD(
	p *chaincfg.Params, host, watchAddr string, check bool, lookahead int, sig chan bool) error

RunIBD calls everything to run IBD

Types

type Csn

type Csn struct {
	CurrentHeight int32

	WatchOPs  map[wire.OutPoint]bool
	WatchAdrs map[[20]byte]bool
	// TODO use better addresses, either []byte or something fancy
	TxChan     chan wire.MsgTx
	HeightChan chan int32

	CheckSignatures bool
	Params          chaincfg.Params
	// contains filtered or unexported fields
}

CsnHook is the main stateful struct for the Compact State Node. It keeps track of what block its on and what transactions it's looking for

func (*Csn) IBDThread

func (c *Csn) IBDThread(sig chan bool)

run IBD from block proof data we get the new utxo info from the same txos text file

func (*Csn) RegisterAddress

func (ch *Csn) RegisterAddress(adr [20]byte)

func (*Csn) RegisterOutPoint

func (ch *Csn) RegisterOutPoint(op wire.OutPoint)

func (*Csn) ScanBlock

func (c *Csn) ScanBlock(b wire.MsgBlock)

ScanBlock looks through a block using the CSN's maps and sends matches into the tx channel.

func (*Csn) Start

func (c *Csn) Start(height int32,
	host, path, proxyURL string,
	params *chaincfg.Params,
	haltSig chan bool) (chan wire.MsgTx, chan int32, error)

Start starts up a compact state node, and returns channels for txs and block heights.

func (*Csn) UnegisterOutPoint

func (ch *Csn) UnegisterOutPoint(op wire.OutPoint)

Jump to

Keyboard shortcuts

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