btcdnotify

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2016 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BtcdNotifier

type BtcdNotifier struct {
	// contains filtered or unexported fields
}

BtcdNotifier implements the ChainNotifier interface using btcd's websockets notifications. Multiple concurrent clients are supported. All notifications are achieved via non-blocking sends on client channels.

func New

func New(config *btcrpcclient.ConnConfig) (*BtcdNotifier, error)

New returns a new BtcdNotifier instance. This function assumes the btcd node detailed in the passed configuration is already running, and willing to accept new websockets clients.

func (*BtcdNotifier) RegisterBlockEpochNtfn

func (b *BtcdNotifier) RegisterBlockEpochNtfn() (*chainntnfs.BlockEpochEvent, error)

RegisterBlockEpochNtfn returns a BlockEpochEvent which subscribes the caller to receive notificationsm, of each new block connected to the main chain.

func (*BtcdNotifier) RegisterConfirmationsNtfn

func (b *BtcdNotifier) RegisterConfirmationsNtfn(txid *wire.ShaHash,
	numConfs uint32) (*chainntnfs.ConfirmationEvent, error)

RegisterConfirmationsNotification registers a notification with BtcdNotifier which will be triggered once the txid reaches numConfs number of confirmations.

func (*BtcdNotifier) RegisterSpendNtfn

func (b *BtcdNotifier) RegisterSpendNtfn(outpoint *wire.OutPoint) (*chainntnfs.SpendEvent, error)

RegisterSpendNotification registers an intent to be notified once the target outpoint has been spent by a transaction on-chain. Once a spend of the target outpoint has been detected, the details of the spending event will be sent across the 'Spend' channel.

func (*BtcdNotifier) Start

func (b *BtcdNotifier) Start() error

Start connects to the running btcd node over websockets, registers for block notifications, and finally launches all related helper goroutines.

func (*BtcdNotifier) Stop

func (b *BtcdNotifier) Stop() error

Stop shutsdown the BtcdNotifier.

Jump to

Keyboard shortcuts

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