uspv

package
v0.0.0-...-ae0a28a Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2016 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// NETVERSION ...
	NETVERSION = wire.TestNet3
	// VERSION ...
	VERSION = 70011
)

Variables

This section is empty.

Functions

func CheckHeader

func CheckHeader(r io.ReadSeeker, height int64, p *chaincfg.Params) bool

CheckHeader ...

func CheckRange

func CheckRange(r io.ReadSeeker, first, last int64, p *chaincfg.Params) bool

CheckRange verifies a range of headers. It checks their proof of work, difficulty adjustments, and that they all link in to each other properly. This is the only blockchain technology in the whole code base. Returns false if anything bad happens. Returns true if the range checks out with no errors.

func MakeMerkleParent

func MakeMerkleParent(left *wire.ShaHash, right *wire.ShaHash) *wire.ShaHash

MakeMerkleParent ...

Types

type MyAdr

type MyAdr struct {
	btcutil.Address
	KeyIdx uint32 // index for private key needed to sign / spend
}

MyAdr ...

type SPVCon

type SPVCon struct {
	WBytes uint64 // total bytes written
	RBytes uint64 // total bytes read

	TS *TxStore
	// contains filtered or unexported fields
}

SPVCon ...

func (*SPVCon) AskForHeaders

func (s *SPVCon) AskForHeaders() error

AskForHeaders ...

func (*SPVCon) AskForMerkBlocks

func (s *SPVCon) AskForMerkBlocks(current, last uint32) error

AskForMerkBlocks ...

func (*SPVCon) IngestHeaders

func (s *SPVCon) IngestHeaders(m *wire.MsgHeaders) (bool, error)

IngestHeaders ...

func (*SPVCon) Open

func (s *SPVCon) Open(remoteNode string, hfn string, inTs *TxStore) error

Open ...

func (*SPVCon) PongBack

func (s *SPVCon) PongBack(nonce uint64)

PongBack ...

func (*SPVCon) SendFilter

func (s *SPVCon) SendFilter(f *bloom.Filter)

SendFilter ...

type TxStore

type TxStore struct {
	KnownTxids []*wire.ShaHash
	Utxos      []Utxo  // stacks on stacks
	Sum        int64   // racks on racks
	Adrs       []MyAdr // endeavouring to acquire capital
}

TxStore ...

func (*TxStore) AbsorbTx

func (t *TxStore) AbsorbTx(tx *wire.MsgTx) error

AbsorbTx absorbs money into wallet from a tx

func (*TxStore) AddAdr

func (t *TxStore) AddAdr(a btcutil.Address, kidx uint32)

AddAdr adds addresses into the TxStore

func (*TxStore) AddTxid

func (t *TxStore) AddTxid(txid *wire.ShaHash) error

AddTxid adds txid of interest

func (*TxStore) ExpellTx

func (t *TxStore) ExpellTx(tx *wire.MsgTx) error

ExpellTx expells money from wallet due to a tx

func (*TxStore) GimmeFilter

func (t *TxStore) GimmeFilter() (*bloom.Filter, error)

GimmeFilter ... or I'm gonna fade away

func (*TxStore) IngestTx

func (t *TxStore) IngestTx(tx *wire.MsgTx) error

IngestTx ingests a tx into wallet, dealing with both gains and losses

type Utxo

type Utxo struct {
	// combo of outpoint and txout which has all the info needed to spend
	Op       wire.OutPoint
	Txo      wire.TxOut
	AtHeight uint32 // block height where this tx was confirmed, 0 for unconf
	KeyIdx   uint32 // index for private key needed to sign / spend
}

Utxo ...

Jump to

Keyboard shortcuts

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