txhelpers

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2017 License: ISC Imports: 11 Imported by: 9

Documentation

Index

Constants

View Source
const (

	// DefaultStakeDbName is the default database name
	DefaultStakeDbName = "ffldb_stake"
)

Variables

This section is empty.

Functions

func BlockConsumesOutpointWithAddresses

func BlockConsumesOutpointWithAddresses(block *dcrutil.Block, addrs map[string]TxAction,
	c *dcrrpcclient.Client, params *chaincfg.Params) map[string][]*dcrutil.Tx

func BlockReceivesToAddresses

func BlockReceivesToAddresses(block *dcrutil.Block, addrs map[string]TxAction,
	params *chaincfg.Params) map[string][]*dcrutil.Tx

BlockReceivesToAddresses checks a block for transactions paying to the specified addresses, and creates a map of addresses to a slice of dcrutil.Tx involving the address.

func BuildStakeTree

func BuildStakeTree(blocks map[int64]*dcrutil.Block, netParams *chaincfg.Params,
	nodeClient *dcrrpcclient.Client, poolRequiredHeight int64, DBName ...string) (database.DB, []int64, error)

func HashInSlice

func HashInSlice(h chainhash.Hash, list []chainhash.Hash) bool

HashInSlice determines if a hash exists in a slice of hashes.

func IncludesStakeTx

func IncludesStakeTx(txHash *chainhash.Hash, block *dcrutil.Block) (int, int8)

IncludesStakeTx checks if a block contains a stake transaction hash

func IncludesTx

func IncludesTx(txHash *chainhash.Hash, block *dcrutil.Block) (int, int8)

IncludesTx checks if a block contains a transaction hash

func MedianAmount

func MedianAmount(s []dcrutil.Amount) dcrutil.Amount

MedianAmount gets the median Amount from a slice of Amounts

func MedianCoin

func MedianCoin(s []float64) float64

MedianCoin gets the median DCR from a slice of float64s

func RevokedTicketsInBlock

func RevokedTicketsInBlock(bl *dcrutil.Block) []chainhash.Hash

RevokedTicketsInBlock finds all the revoked tickets in the block.

func TicketsInBlock

func TicketsInBlock(bl *dcrutil.Block) []chainhash.Hash

TicketsInBlock finds all the new tickets in the block.

func TicketsSpentInBlock

func TicketsSpentInBlock(bl *dcrutil.Block) []chainhash.Hash

TicketsSpentInBlock finds all the tickets spent in the block.

func TxhashInSlice

func TxhashInSlice(txs []*dcrutil.Tx, txHash *chainhash.Hash) *dcrutil.Tx

func VotesInBlock

func VotesInBlock(bl *dcrutil.Block) []chainhash.Hash

VotesInBlock finds all the votes in the block.

Types

type BlockWatchedTx

type BlockWatchedTx struct {
	BlockHeight   int64
	TxsForAddress map[string][]*dcrutil.Tx
}

BlockWatchedTx contains, for a certain block, the transactions for certain watched addresses

type TxAction

type TxAction int32

TxAction is what is happening to the transaction (mined or inserted into mempool).

const (
	TxMined TxAction = 1 << iota
	TxInserted
)

Valid values for TxAction

Jump to

Keyboard shortcuts

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