mempool

package
v0.0.0-...-0b9d80d Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2016 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package mempool provides a Pool implementation that keeps all pending transactions in memory.

It is used in tests to avoid needing a database and is not safe for concurrent access.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemPool

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

MemPool satisfies the protocol.Pool interface.

func New

func New() *MemPool

New returns a new MemPool.

func (*MemPool) Dump

func (m *MemPool) Dump(context.Context) ([]*bc.Tx, error)

Dump returns all pending transactions in the pool and empties the pool.

func (*MemPool) Insert

func (m *MemPool) Insert(ctx context.Context, tx *bc.Tx) error

Insert adds a new pending tx to the pending tx pool.

Jump to

Keyboard shortcuts

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