mining

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2018 License: BSD-2-Clause Imports: 29 Imported by: 3

Documentation

Index

Constants

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

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

	//DefaultMaxBlockSize = 32 * OneMegaByte
	DefaultMaxBlockSize = wire.MaxBlockPayload

	/*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 = "copernicus"
)

Variables

global value in mining module

Functions

func BasicScriptSig added in v0.0.3

func BasicScriptSig() *script.Script

func CoinbaseScriptSig added in v0.0.3

func CoinbaseScriptSig(extraNonce uint) *script.Script

func GetBlockSize

func GetBlockSize() uint64

func GetLastBlockSize

func GetLastBlockSize() uint64

func GetLastBlockTx

func GetLastBlockTx() uint64

func SetBlockSize

func SetBlockSize(size uint64)

func TestBlockValidity

func TestBlockValidity(block *block.Block, indexPrev *blockindex.BlockIndex, checkHeader bool, checkMerlke bool) (err error)

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 *model.BitcoinParams) *BlockAssembler

func (*BlockAssembler) CreateNewBlock

func (ba *BlockAssembler) CreateNewBlock(scriptPubKey, scriptSig *script.Script) *BlockTemplate

type BlockTemplate

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

type ByAncsCount added in v0.0.3

type ByAncsCount []*mempool.TxEntry

func (ByAncsCount) Len added in v0.0.3

func (a ByAncsCount) Len() int

func (ByAncsCount) Less added in v0.0.3

func (a ByAncsCount) Less(i, j int) bool

func (ByAncsCount) Swap added in v0.0.3

func (a ByAncsCount) Swap(i, j int)

type EntryAncestorFeeRateSort

type EntryAncestorFeeRateSort mempool.TxEntry

EntryAncestorFeeRateSort TxEntry sorted by feeRateWithAncestors

func (EntryAncestorFeeRateSort) Less

type EntryFeeSort

type EntryFeeSort mempool.TxEntry

EntryFeeSort TxEntry sorted by feeWithAncestors

func (EntryFeeSort) Less

func (e EntryFeeSort) Less(than mapcontainer.Lesser) bool

Jump to

Keyboard shortcuts

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