notification

package
v4.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2019 License: ISC Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NtfnChans struct {
	ConnectChan                       chan *chainhash.Hash
	ReorgChanBlockData                chan *txhelpers.ReorgData
	ConnectChanWiredDB                chan *chainhash.Hash
	ReorgChanWiredDB                  chan *txhelpers.ReorgData
	ConnectChanStakeDB                chan *chainhash.Hash
	ReorgChanStakeDB                  chan *txhelpers.ReorgData
	ConnectChanDcrpgDB                chan *chainhash.Hash
	ReorgChanDcrpgDB                  chan *txhelpers.ReorgData
	UpdateStatusNodeHeight            chan uint32
	UpdateStatusDBHeight              chan uint32
	SpendTxBlockChan, RecvTxBlockChan chan *txhelpers.BlockWatchedTx
	RelevantTxMempoolChan             chan *dcrutil.Tx
	NewTxChan                         chan *dcrjson.TxRawResult
	InsightNewTxChan                  chan *insight.NewTx
}

NtfnChans collects the chain server notification channels

Functions

func CloseNtfnChans

func CloseNtfnChans()

CloseNtfnChans close all notification channels

func DisableLog

func DisableLog()

DisableLog disables all library log output. Logging output is disabled by default until UseLogger is called.

func MakeNodeNtfnHandlers

func MakeNodeNtfnHandlers() (*rpcclient.NotificationHandlers, *collectionQueue)

MakeNodeNtfnHandlers defines the dcrd notification handlers.

func MakeNtfnChans

func MakeNtfnChans(postgresEnabled bool)

MakeNtfnChans create notification channels based on config

func NewCollectionQueue

func NewCollectionQueue() *collectionQueue

NewCollectionQueue creates a new collectionQueue with an unbuffered channel to facilitate synchronous processing. Run (*collectionQueue).ProcessBlocks as a goroutine to begin processing blocks sent to the channel, or call processBlock for each new block.

func UseLogger

func UseLogger(logger slog.Logger)

UseLogger uses a specified Logger to output package logging info.

Types

type ContextualError

type ContextualError struct {
	RootErr error
	Err     error
}

ContextualError models an error and its root error and is returned by registerNodeNtfnHandlers

func RegisterNodeNtfnHandlers

func RegisterNodeNtfnHandlers(dcrdClient *rpcclient.Client) *ContextualError

RegisterNodeNtfnHandlers registers with dcrd to receive new block, transaction and winning ticket notifications.

func (*ContextualError) Cause

func (e *ContextualError) Cause() string

Cause returns the root error string

func (*ContextualError) Error

func (e *ContextualError) Error() string

type ReorgData

type ReorgData struct {
	OldChainHead   chainhash.Hash
	OldChainHeight int32
	NewChainHead   chainhash.Hash
	NewChainHeight int32
	WG             *sync.WaitGroup
}

ReorgData describes the old and new chain tips involved in a reorganization.

Jump to

Keyboard shortcuts

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