mining

package
v0.0.0-...-9bfe29d Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2016 License: ISC Imports: 3 Imported by: 0

README

mining

[Build Status] (https://travis-ci.org/conseweb/stcd) ![ISC License] (http://img.shields.io/badge/license-ISC-blue.svg) [GoDoc] (http://godoc.org/github.com/conseweb/stcd/mining)

Overview

This package is currently a work in progress.

Installation and Updating

$ go get -u github.com/conseweb/stcd/mining

License

Package mining is licensed under the copyfree ISC License.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Policy

type Policy struct {
	// BlockMinSize is the minimum block size in bytes to be used when
	// generating a block template.
	BlockMinSize uint32

	// BlockMaxSize is the maximum block size in bytes to be used when
	// generating a block template.
	BlockMaxSize uint32

	// BlockPrioritySize is the size in bytes for high-priority / low-fee
	// transactions to be used when generating a block template.
	BlockPrioritySize uint32

	// TxMinFreeFee is the minimum fee in Satoshi/1000 bytes that is
	// required for a transaction to be treated as free for mining purposes
	// (block template generation).
	TxMinFreeFee coinutil.Amount
}

Policy houses the policy (configuration parameters) which is used to control the generation of block templates. See the documentation for NewBlockTemplate for more details on each of these parameters are used.

type TxDesc

type TxDesc struct {
	// Tx is the transaction associated with the entry.
	Tx *coinutil.Tx

	// Added is the time when the entry was added to the source pool.
	Added time.Time

	// Height is the block height when the entry was added to the the source
	// pool.
	Height int32

	// Fee is the total fee the transaction associated with the entry pays.
	Fee int64
}

TxDesc is a descriptor about a transaction in a transaction source along with additional metadata.

type TxSource

type TxSource interface {
	// LastUpdated returns the last time a transaction was added to or
	// removed from the source pool.
	LastUpdated() time.Time

	// MiningDescs returns a slice of mining descriptors for all the
	// transactions in the source pool.
	MiningDescs() []*TxDesc

	// HaveTransaction returns whether or not the passed transaction hash
	// exists in the source pool.
	HaveTransaction(hash *wire.ShaHash) bool
}

TxSource represents a source of transactions to consider for inclusion in new blocks.

The interface contract requires that all of these methods are safe for concurrent access with respect to the source.

Jump to

Keyboard shortcuts

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