powless

package
v0.0.0-...-793c700 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2017 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRawTx

func GetRawTx(txid string) (*wire.MsgTx, error)

GetRawTx is a helper function to get a tx from the insight api

Types

type APILink struct {

	// TrackingAdrs and OPs are slices of addresses and outpoints to watch for.
	// Using struct{} saves a byte of RAM but is ugly so I'll use bool.
	TrackingAdrs    map[[20]byte]bool
	TrackingAdrsMtx sync.Mutex

	TrackingOPs    map[wire.OutPoint]bool
	TrackingOPsMtx sync.Mutex

	TxUpToWallit chan lnutil.TxAndHeight

	CurrentHeightChan chan int32
	// contains filtered or unexported fields
}

APILink is a link to a web API that can tell you about blockchain data.

func (*APILink) ClockLoop

func (a *APILink) ClockLoop()

func (*APILink) GetAdrTxos

func (a *APILink) GetAdrTxos() error

GetAdrTxos ...use insight api. at least that's open source, can run yourself, seems to have some dev activity behind it.

func (*APILink) GetOPTxs

func (a *APILink) GetOPTxs() error

func (*APILink) PushTx

func (a *APILink) PushTx(tx *wire.MsgTx) error

PushTx pushes a tx to the network via the smartbit site / api smartbit supports segwit so

func (*APILink) RawBlocks

func (a *APILink) RawBlocks() chan *wire.MsgBlock

func (*APILink) RegisterAddress

func (a *APILink) RegisterAddress(adr160 [20]byte) error

RegisterAddress gets a 20 byte address from the wallit and starts watching for utxos at that address.

func (*APILink) RegisterOutPoint

func (a *APILink) RegisterOutPoint(op wire.OutPoint) error

RegisterOutPoint gets an outpoint from the wallit and starts looking for txins that spend it.

func (*APILink) Start

func (a *APILink) Start(
	startHeight int32, host, path string, params *chaincfg.Params) (
	chan lnutil.TxAndHeight, chan int32, error)

Start starts the APIlink

func (*APILink) UpdateHeight

func (a *APILink) UpdateHeight(height int32)

type AdrUtxoResponse

type AdrUtxoResponse struct {
	Txid     string
	Height   int32
	Satoshis int64
}

ARGHGH all fields have to be exported (caps) or the json unmarshaller won't populate them !

type RawTxResponse

type RawTxResponse struct {
	RawTx string
}

do you even need a struct here..?

type TxResponse

type TxResponse struct {
	Txid        string
	Blockheight int32
	Vout        []VoutJson
}

type VoutJson

type VoutJson struct {
	N           uint32
	SpentTxId   string
	SpentHeight int32
}

Get txid of spending tx

Jump to

Keyboard shortcuts

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