mining

package
v0.0.0-...-a24b6ab Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2018 License: BSD-2-Clause Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	/*MaxTxSigOpsCount allowed number of signature check operations per transaction. */
	MaxTxSigOpsCount uint64 = 20000
	/*OneMegaByte 1MB */
	OneMegaByte uint64 = 1000000

	/*DefaultMaxGeneratedBlockSize default for -blockMaxsize, which controls the maximum size of block the
	 * mining code will create **/
	DefaultMaxGeneratedBlockSize uint64 = 2 * OneMegaByte

	DefaultMaxBlockSize = 8 * OneMegaByte

	/*DefaultBlockPrioritySize default for -blockPrioritySize, maximum space for zero/low-fee transactions*/
	DefaultBlockPrioritySize uint64 = 0

	/*DefaultBlockMinTxFee default for -blockMinTxFee, which sets the minimum feeRate for a transaction
	 * in blocks created by mining code **/
	DefaultBlockMinTxFee uint = 1000

	/*MaxStandardTxSize the maximum size for transactions we're willing to relay/mine */
	MaxStandardTxSize uint = 100000

	/*MaxP2SHSigOps maximum number of signature check operations in an IsStandard() P2SH script*/
	MaxP2SHSigOps uint = 15

	/*MaxStandardTxSigOps the maximum number of sigops we're willing to relay/mine in a single tx */
	MaxStandardTxSigOps = uint(MaxTxSigOpsCount / 5)

	DefaultTransactionMaxfee = util.COIN / 10
)
View Source
const (
	CoinbaseFlag = ""
)

todo define Coinbase Flag for miner or pool

Variables

global value in mining module

Functions

func GetBlockSize

func GetBlockSize() uint64

func GetBlockSubsidy

func GetBlockSubsidy(height int32, params *chainparams.BitcoinParams) amount.Amount

func GetLastBlockSize

func GetLastBlockSize() uint64

func GetLastBlockTx

func GetLastBlockTx() uint64

func IncrementExtraNonce

func IncrementExtraNonce(bk *block.Block, bindex *blockindex.BlockIndex) (extraNonce uint)

func SetBlockSize

func SetBlockSize(size uint64)

func UpdateTime

func UpdateTime(bk *block.Block, indexPrev *blockindex.BlockIndex) int64

Types

type BlockAssembler

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

BlockAssembler Generate a new block, without valid proof-of-work

func NewBlockAssembler

func NewBlockAssembler(params *chainparams.BitcoinParams) *BlockAssembler

func (*BlockAssembler) CreateNewBlock

func (ba *BlockAssembler) CreateNewBlock(coinbaseScript *script.Script) *BlockTemplate

type BlockTemplate

type BlockTemplate struct {
	Block         *block.Block
	TxFees        []amount.Amount
	TxSigOpsCount []int
}

type EntryAncestorFeeRateSort

type EntryAncestorFeeRateSort mempool.TxEntry

EntryAncestorFeeRateSort TxEntry sorted by feeRateWithAncestors

func (EntryAncestorFeeRateSort) Less

func (r EntryAncestorFeeRateSort) Less(than btree.Item) bool

type EntryFeeSort

type EntryFeeSort mempool.TxEntry

EntryFeeSort TxEntry sorted by feeWithAncestors

func (EntryFeeSort) Less

func (e EntryFeeSort) Less(than btree.Item) bool

Jump to

Keyboard shortcuts

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