listen

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: May 8, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProcessBlock

func ProcessBlock(ctx context.Context, client *ethclient.Client, number *big.Int, commChan chan<- CaughtTxs, lastSeenBlockChan chan<- uint64) bool

ProcessBlock - Fetches all txs present in mined block & passes those to pending pool pruning worker

func SubscribeHead

func SubscribeHead(ctx context.Context, client *ethclient.Client, lastSeenBlock uint64, commChan chan<- CaughtTxs, lastSeenBlockChan chan<- uint64, healthChan chan struct{})

SubscribeHead - Subscribe to block headers & as soon as new block gets mined its txs are picked up & published on a go channel, which will be listened to by pending pool watcher, so that it can prune its state

Types

type CaughtTx

type CaughtTx struct {
	Hash  common.Hash
	Nonce uint64
}

CaughtTx - Tx caught by block head subscriber, passed to pending pool watcher, so that it can prune its state

type CaughtTxs

type CaughtTxs []*CaughtTx

CaughtTxs - Just a slice of txs, which we found to be present in a recently mined block

Jump to

Keyboard shortcuts

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