Versions in this module Expand all Collapse all v0 v0.0.2 Feb 8, 2016 Changes in this version + const CheckpointConfirmations + const MaxCoinbaseScriptLen + const MaxSigOpsPerBlock + const MaxTimeOffsetSeconds + const MinCoinbaseScriptLen + const TiAvailable + const TiError + const TiMissed + const TiNonexisting + const TiRevoked + const TiSpent + const ViewpointPrevInvalidRegular + const ViewpointPrevInvalidStake + const ViewpointPrevValidInitial + const ViewpointPrevValidRegular + const ViewpointPrevValidStake + var ErrIndexAlreadyInitialized = errors.New(...) + func BigToCompact(n *big.Int) uint32 + func BlockOneCoinbasePaysTokens(tx *dcrutil.Tx, params *chaincfg.Params) error + func BuildMerkleTreeStore(transactions []*dcrutil.Tx) []*chainhash.Hash + func CalcBlockTaxSubsidy(height int64, voters uint16, params *chaincfg.Params) int64 + func CalcBlockWorkSubsidy(height int64, voters uint16, params *chaincfg.Params) int64 + func CalcStakeVoteSubsidy(height int64, params *chaincfg.Params) int64 + func CalcWork(bits uint32) *big.Int + func CheckBlockSanity(block *dcrutil.Block, timeSource MedianTimeSource, ...) error + func CheckProofOfStake(block *dcrutil.Block, posLimit int64) error + func CheckProofOfWork(block *dcrutil.Block, powLimit *big.Int) error + func CheckTransactionInputs(tx *dcrutil.Tx, txHeight int64, txStore TxStore, checkFraudProof bool, ...) (int64, error) + func CheckTransactionSanity(tx *dcrutil.Tx, params *chaincfg.Params) error + func CheckWorklessBlockSanity(block *dcrutil.Block, timeSource MedianTimeSource, ...) error + func CoinbasePaysTax(tx *dcrutil.Tx, height uint32, voters uint16, params *chaincfg.Params) error + func CompactToBig(compact uint32) *big.Int + func CountP2SHSigOps(tx *dcrutil.Tx, isCoinBaseTx bool, isStakeBaseTx bool, txStore TxStore) (int, error) + func CountSigOps(tx *dcrutil.Tx, isCoinBaseTx bool, isSSGen bool) int + func DebugBlockHeaderString(chainParams *chaincfg.Params, block *dcrutil.Block) string + func DebugBlockString(block *dcrutil.Block) string + func DebugMsgTxString(msgTx *wire.MsgTx) string + func DebugTicketDBLiveBucketString(tmdb *stake.TicketDB, bucket uint8, verbose bool) (string, error) + func DebugTicketDBLiveString(tmdb *stake.TicketDB, chainParams *chaincfg.Params) (string, error) + func DebugTicketDBMissedString(tmdb *stake.TicketDB, verbose bool) (string, error) + func DebugTicketDBSpentBucketString(tmdb *stake.TicketDB, height int64, verbose bool) (string, error) + func DebugTicketDataString(td *stake.TicketData) string + func DebugTxStoreData(txs TxStore) string + func DisableLog() + func HashMerkleBranches(left *chainhash.Hash, right *chainhash.Hash) *chainhash.Hash + func IsCoinBase(tx *dcrutil.Tx) bool + func IsCoinBaseTx(msgTx *wire.MsgTx) bool + func IsFinalizedTransaction(tx *dcrutil.Tx, blockHeight int64, blockTime time.Time) bool + func SetLogWriter(w io.Writer, level string) error + func ShaHashToBig(hash *chainhash.Hash) *big.Int + func TicketDbThumbprint(tmdb *stake.TicketDB, chainParams *chaincfg.Params) ([]*chainhash.Hash, error) + func UseLogger(logger btclog.Logger) + func ValidateTransactionScripts(tx *dcrutil.Tx, txStore TxStore, flags txscript.ScriptFlags) error + type BehaviorFlags uint32 + const BFDryRun + const BFFastAdd + const BFNoPoWCheck + const BFNone + type BlockAcceptedNtfnsData struct + Block *dcrutil.Block + OnMainChain bool + type BlockChain struct + func New(db database.Db, tmdb *stake.TicketDB, params *chaincfg.Params, ...) *BlockChain + func (b *BlockChain) BlockLocatorFromHash(hash *chainhash.Hash) BlockLocator + func (b *BlockChain) CalcNextRequiredDiffFromNode(hash *chainhash.Hash, timestamp time.Time) (uint32, error) + func (b *BlockChain) CalcNextRequiredDifficulty(timestamp time.Time) (uint32, error) + func (b *BlockChain) CalcNextRequiredStakeDifficulty() (int64, error) + func (b *BlockChain) CalcPastMedianTime() (time.Time, error) + func (b *BlockChain) CheckBlockStakeSanity(tixStore TicketStore, stakeValidationHeight int64, node *blockNode, ...) error + func (b *BlockChain) CheckConnectBlock(block *dcrutil.Block) error + func (b *BlockChain) Checkpoints() []chaincfg.Checkpoint + func (b *BlockChain) DisableCheckpoints(disable bool) + func (b *BlockChain) DisableVerify(disable bool) + func (b *BlockChain) FetchTransactionStore(tx *dcrutil.Tx, isValid bool) (TxStore, error) + func (b *BlockChain) ForceHeadReorganization(formerBest chainhash.Hash, newBest chainhash.Hash, timeSource MedianTimeSource) error + func (b *BlockChain) GenerateInitialIndex() error + func (b *BlockChain) GenerateLiveTicketBucket(ticketStore TicketStore, tpdBucketMap map[uint8][]*TicketPatchData, ...) (stake.SStxMemMap, error) + func (b *BlockChain) GenerateMissedTickets(tixStore TicketStore) (stake.SStxMemMap, error) + func (b *BlockChain) GetBlockFromHash(hash *chainhash.Hash) (*dcrutil.Block, error) + func (b *BlockChain) GetCurrentBlockHeader() *wire.BlockHeader + func (b *BlockChain) GetGeneration(hash chainhash.Hash) ([]chainhash.Hash, error) + func (b *BlockChain) GetMissedTickets() []chainhash.Hash + func (b *BlockChain) GetNextWinningTickets() ([]chainhash.Hash, int, [6]byte, error) + func (b *BlockChain) GetOrphanRoot(hash *chainhash.Hash) *chainhash.Hash + func (b *BlockChain) GetTopBlock() (dcrutil.Block, error) + func (b *BlockChain) GetWinningTickets(nodeHash chainhash.Hash) ([]chainhash.Hash, int, [6]byte, error) + func (b *BlockChain) HaveBlock(hash *chainhash.Hash) (bool, error) + func (b *BlockChain) IsCheckpointCandidate(block *dcrutil.Block) (bool, error) + func (b *BlockChain) IsCurrent(timeSource MedianTimeSource) bool + func (b *BlockChain) IsKnownOrphan(hash *chainhash.Hash) bool + func (b *BlockChain) LatestBlockLocator() (BlockLocator, error) + func (b *BlockChain) LatestCheckpoint() *chaincfg.Checkpoint + func (b *BlockChain) MissedTickets() (stake.SStxMemMap, error) + func (b *BlockChain) ProcessBlock(block *dcrutil.Block, timeSource MedianTimeSource, flags BehaviorFlags) (bool, bool, error) + func (b *BlockChain) StakeValidationHeight() int64 + func (b *BlockChain) TicketsWithAddress(address dcrutil.Address) ([]chainhash.Hash, error) + type BlockLocator []*chainhash.Hash + type ErrorCode int + const ErrBIP0030 + const ErrBadBlockHeight + const ErrBadCheckpoint + const ErrBadCoinbaseAmountIn + const ErrBadCoinbaseFraudProof + const ErrBadCoinbaseOutpoint + const ErrBadCoinbaseScriptLen + const ErrBadCoinbaseValue + const ErrBadFees + const ErrBadMerkleRoot + const ErrBadStakebaseAmountIn + const ErrBadStakebaseScriptLen + const ErrBadStakebaseValue + const ErrBadStakevaseScrVal + const ErrBadTxInput + const ErrBadTxOutValue + const ErrBlockOneInputs + const ErrBlockOneOutputs + const ErrBlockOneTx + const ErrBlockTooBig + const ErrBlockVersionTooOld + const ErrCheckpointTimeTooOld + const ErrCoinbaseHeight + const ErrDifficultyTooLow + const ErrDiscordantTxTree + const ErrDoubleSpend + const ErrDuplicateBlock + const ErrDuplicateTx + const ErrDuplicateTxInputs + const ErrExpiredTx + const ErrExpiryTxSpentEarly + const ErrFirstTxNotCoinbase + const ErrForceReorgMissingChild + const ErrForceReorgWrongChain + const ErrForkTooOld + const ErrFraudAmountIn + const ErrFraudBlockHeight + const ErrFraudBlockIndex + const ErrFreshStakeMismatch + const ErrHighHash + const ErrImmatureSpend + const ErrIncongruentVotebit + const ErrInvalidEarlyStakeTx + const ErrInvalidEarlyVoteBits + const ErrInvalidFinalState + const ErrInvalidRevNum + const ErrInvalidSSGenInput + const ErrInvalidSSRtx + const ErrInvalidSSRtxInput + const ErrInvalidTime + const ErrMissingParent + const ErrMissingTx + const ErrMultipleCoinbases + const ErrNoStakeTx + const ErrNoTax + const ErrNoTransactions + const ErrNoTxInputs + const ErrNoTxOutputs + const ErrNonstandardStakeTx + const ErrNotEnoughStake + const ErrNotEnoughVotes + const ErrOverwriteTx + const ErrPoolSize + const ErrRegTxInStakeTree + const ErrRegTxSpendStakeOut + const ErrSSGenPayeeNum + const ErrSSGenPayeeOuts + const ErrSSGenSubsidy + const ErrSSRtxPayees + const ErrSSRtxPayeesMismatch + const ErrSStxCommitment + const ErrSStxInImmature + const ErrSStxInScrType + const ErrScriptMalformed + const ErrScriptValidation + const ErrSpendTooHigh + const ErrStakeBelowMinimum + const ErrStakeFees + const ErrStakeTxInRegularTree + const ErrTicketUnavailable + const ErrTimeTooNew + const ErrTimeTooOld + const ErrTooManyRevocations + const ErrTooManySStxs + const ErrTooManySigOps + const ErrTooManyTransactions + const ErrTooManyVotes + const ErrTxSStxOutSpend + const ErrTxTooBig + const ErrUnexpectedDifficulty + const ErrUnfinalizedTx + const ErrUnparseableSSGen + const ErrVotesMismatch + const ErrVotesOnWrongBlock + const ErrWrongBlockSize + const ErrZeroValueOutputSpend + func (e ErrorCode) String() string + type MedianTimeSource interface + AddTimeSample func(id string, timeVal time.Time) + AdjustedTime func() time.Time + Offset func() time.Duration + func NewMedianTime() MedianTimeSource + type Notification struct + Data interface{} + Type NotificationType + type NotificationCallback func(*Notification) + type NotificationType int + const NTBlockAccepted + const NTBlockConnected + const NTBlockDisconnected + const NTNewTickets + const NTReorganization + const NTSpentAndMissedTickets + func (n NotificationType) String() string + type ReorganizationNtfnsData struct + NewHash chainhash.Hash + NewHeight int64 + OldHash chainhash.Hash + OldHeight int64 + type RuleError struct + Description string + ErrorCode ErrorCode + func (e RuleError) Error() string + func (e RuleError) GetCode() ErrorCode + type TicketNotificationsData struct + Hash chainhash.Hash + Height int64 + StakeDifficulty int64 + TicketMap stake.SStxMemMap + type TicketPatchData struct + func NewTicketPatchData(td *stake.TicketData, ts TicketStatus, err error) *TicketPatchData + type TicketStatus int + type TicketStore map[chainhash.Hash]*TicketPatchData + type TxData struct + BlockHeight int64 + BlockIndex uint32 + Err error + Hash *chainhash.Hash + Spent []bool + Tx *dcrutil.Tx + type TxStore map[chainhash.Hash]*TxData