wire

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

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

Go to latest
Published: Apr 18, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

wire implements the network logic for transactions that include the utreexo accumulator proofs

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlockToAddLeaves

func BlockToAddLeaves(
	blk *btcutil.Block,
	remember []bool,
	skiplist []uint32,
	height int32,
	outCount uint32) (leaves []accumulator.Leaf)

BlockToAdds turns all the new utxos in a msgblock into leafTxos uses remember slice up to number of txos, but doesn't check that it's the right length. Similar with skiplist, doesn't check it.

func UblockNetworkReader

func UblockNetworkReader(
	blockChan chan UBlock, remoteServer string,
	curHeight, lookahead int32)

UblockNetworkReader gets Ublocks from the remote host and puts em in the channel. It'll try to fill the channel buffer.

Types

type UBlock

type UBlock struct {
	UtreexoData btcacc.UData
	Block       *btcutil.Block
}

UBlock is a regular block, with Udata stuck on

func (*UBlock) CheckBlock

func (ub *UBlock) CheckBlock(outskip []uint32, p *chaincfg.Params) bool

CheckBlock does all internal block checks for a UBlock right now checks the signatures

func (*UBlock) Deserialize

func (ub *UBlock) Deserialize(r io.Reader) (err error)

Deserialize a UBlock. It's just a block then udata.

func (*UBlock) ProofSanity

func (ub *UBlock) ProofSanity(nl uint64, h uint8) error

ProofSanity checks the consistency of a UBlock. Does the proof prove all the inputs in the block?

func (*UBlock) Serialize

func (ub *UBlock) Serialize(w io.Writer) (err error)

We don't actually call serialize since from the server side we don't serialize, we just glom stuff together from the disk and send it over.

func (*UBlock) SerializeSize

func (ub *UBlock) SerializeSize() int

SerializeSize: how big is it, in bytes.

func (*UBlock) ToUtxoView

func (ub *UBlock) ToUtxoView() *blockchain.UtxoViewpoint

ToUtxoView converts a UData into a btcd blockchain.UtxoViewpoint all the data is there, just a bit different format. Note that this needs blockchain.NewUtxoEntry() in btcd

Jump to

Keyboard shortcuts

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