mempool

package
v0.0.0-...-2e52d37 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
const DEFAULT_SIZE = 2 << 24

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	*BloomFilter
	// contains filtered or unexported fields
}

func NewBackend

func NewBackend(limit int) *Backend

type BloomFilter

type BloomFilter struct {
	Set   *bitset.BitSet
	Funcs [6]SimpleHash
}

func NewBloomFilter

func NewBloomFilter() *BloomFilter

func (BloomFilter) Add

func (bf BloomFilter) Add(value string)

func (BloomFilter) Contains

func (bf BloomFilter) Contains(value string) bool

type MemPool

type MemPool struct {
	*Backend
}

func NewMemPool

func NewMemPool() *MemPool

NewTransactions creates a new memory pool for transactions.

type Producer

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

func NewProducer

func NewProducer() *Producer

func (*Producer) AddTxn

func (pd *Producer) AddTxn(txn *message.Transaction)

func (*Producer) CollectTxn

func (pd *Producer) CollectTxn(txn *message.Transaction)

func (*Producer) GeneratePayload

func (pd *Producer) GeneratePayload() []*message.Transaction

func (*Producer) TotalReceivedTxNo

func (pd *Producer) TotalReceivedTxNo() int64

type SimpleHash

type SimpleHash struct {
	Cap  uint
	Seed uint
}

Jump to

Keyboard shortcuts

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