notifymgr

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: ISC Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const MaxNotifyProcessTimeout = time.Second * 30
View Source
const NotifyTickerDur = time.Second

Variables

This section is empty.

Functions

This section is empty.

Types

type NotifyMgr

type NotifyMgr struct {
	service.Service

	Server    *p2p.Service
	RpcServer *rpc.RpcServer

	sync.Mutex
	// contains filtered or unexported fields
}

NotifyMgr manage message announce & relay & notification between mempool, websocket, gbt long pull and rpc server.

func New

func New(p2pServer *p2p.Service, consensus model.Consensus) *NotifyMgr

func (*NotifyMgr) AddRebroadcastInventory

func (ntmgr *NotifyMgr) AddRebroadcastInventory(newTxs []*types.TxDesc)

func (*NotifyMgr) AnnounceNewTransactions

func (ntmgr *NotifyMgr) AnnounceNewTransactions(newTxs []*types.TxDesc, filters []peer.ID)

AnnounceNewTransactions generates and relays inventory vectors and notifies both websocket and getblocktemplate long poll clients of the passed transactions. This function should be called whenever new transactions are added to the mempool.

func (*NotifyMgr) BroadcastMessage

func (ntmgr *NotifyMgr) BroadcastMessage(data interface{})

func (*NotifyMgr) IsTimeout

func (ntmgr *NotifyMgr) IsTimeout() bool

func (*NotifyMgr) RelayInventory

func (ntmgr *NotifyMgr) RelayInventory(block *types.SerializedBlock, flags uint32, source *peer.ID)

RelayInventory relays the passed inventory vector to all connected peers that are not already known to have it.

func (*NotifyMgr) Reset

func (ntmgr *NotifyMgr) Reset()

func (*NotifyMgr) Start

func (ntmgr *NotifyMgr) Start() error

func (*NotifyMgr) Stop

func (ntmgr *NotifyMgr) Stop() error

func (*NotifyMgr) TransactionConfirmed

func (ntmgr *NotifyMgr) TransactionConfirmed(tx *types.Tx)

Transaction has one confirmation on the main chain. Now we can mark it as no longer needing rebroadcasting.

func (*NotifyMgr) TransactionsConfirmed added in v1.2.0

func (ntmgr *NotifyMgr) TransactionsConfirmed(txs []*types.Tx)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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