Versions in this module Expand all Collapse all v3 deprecated v3.0.1 Jun 10, 2023 v3.0.0 Oct 13, 2020 Changes in this version + const ErrDatabaseCorrupt + const ErrDuplicateTicket + const ErrFindTicketIdxs + const ErrMemoryCorruption + const ErrMissingDatabaseTx + const ErrMissingTicket + const ErrSSGenBadGenOuts + const ErrSSGenBadReference + const ErrSSGenBadVotePush + const ErrSSGenDuplicateTreasuryVote + const ErrSSGenInvalidDiscriminatorLength + const ErrSSGenInvalidNullScript + const ErrSSGenInvalidTVLength + const ErrSSGenInvalidTreasuryVote + const ErrSSGenInvalidTxVersion + const ErrSSGenNoOutputs + const ErrSSGenNoReference + const ErrSSGenNoStakebase + const ErrSSGenNoVotePush + const ErrSSGenTooManyOutputs + const ErrSSGenUnknownDiscriminator + const ErrSSGenWrongIndex + const ErrSSGenWrongNumInputs + const ErrSSGenWrongTxTree + const ErrSSRtxBadOuts + const ErrSSRtxNoOutputs + const ErrSSRtxTooManyOutputs + const ErrSSRtxWrongNumInputs + const ErrSSRtxWrongTxTree + const ErrSStxBadChangeAmts + const ErrSStxBadCommitAmount + const ErrSStxInOutProportions + const ErrSStxInvalidInputs + const ErrSStxInvalidOutputs + const ErrSStxNoOutputs + const ErrSStxTooManyInputs + const ErrSStxTooManyOutputs + const ErrSStxVerifyCalcAmts + const ErrTAddInvalidChange + const ErrTAddInvalidCount + const ErrTAddInvalidLength + const ErrTAddInvalidOpcode + const ErrTAddInvalidScriptLength + const ErrTAddInvalidTxVersion + const ErrTAddInvalidVersion + const ErrTSpendInvalidLength + const ErrTSpendInvalidPubkey + const ErrTSpendInvalidScript + const ErrTSpendInvalidScriptLength + const ErrTSpendInvalidSpendScript + const ErrTSpendInvalidTGen + const ErrTSpendInvalidTransaction + const ErrTSpendInvalidTxVersion + const ErrTSpendInvalidVersion + const ErrTreasuryBaseInvalid + const ErrTreasuryBaseInvalidCount + const ErrTreasuryBaseInvalidLength + const ErrTreasuryBaseInvalidOpcode0 + const ErrTreasuryBaseInvalidOpcode1 + const ErrTreasuryBaseInvalidTxVersion + const ErrTreasuryBaseInvalidVersion + const ErrUnknownTicketSpent + const ErrVerSStxAmts + const ErrVerifyInput + const ErrVerifyOutPkhs + const ErrVerifyOutType + const ErrVerifyOutputAmt + const ErrVerifySpendTooMuch + const ErrVerifyTooMuchFees + const MaxInputsPerSStx + const MaxOutputsPerSSGen + const MaxOutputsPerSSRtx + const MaxOutputsPerSStx + const MaxSingleBytePushLength + const NumInputsPerSSGen + const NumInputsPerSSRtx + const SSGenBlockReferenceOutSize + const SSGenVoteBitsExtendedMaxSize + const SSGenVoteBitsOutputMaxSize + const SSGenVoteBitsOutputMinSize + const SStxPKHMaxOutSize + const SStxPKHMinOutSize + const SStxRevFractionFlag + const SStxRevReturnFractionMask + const SStxVoteFractionFlag + const SStxVoteReturnFractionMask + const TSpendScriptLen + const VoteConsensusVersionAbsent + func AddrFromSStxPkScrCommitment(pkScript []byte, params dcrutil.AddressParams) (dcrutil.Address, error) + func AmountFromSStxPkScrCommitment(pkScript []byte) (dcrutil.Amount, error) + func CalcHash256PRNGIV(seed []byte) chainhash.Hash + func CalculateRewards(amounts []int64, amountTicket int64, subsidy int64) []int64 + func CheckSSGen(tx *wire.MsgTx, isTreasuryEnabled bool) error + func CheckSSRtx(tx *wire.MsgTx) error + func CheckSStx(tx *wire.MsgTx) error + func CheckTAdd(mtx *wire.MsgTx) error + func CheckTSpend(mtx *wire.MsgTx) ([]byte, []byte, error) + func CheckTreasuryBase(mtx *wire.MsgTx) error + func IsNullDataScript(scriptVersion uint16, script []byte) bool + func IsRevocationScript(version uint16, script []byte) bool + func IsSSGen(tx *wire.MsgTx, isTreasuryEnabled bool) bool + func IsSSRtx(tx *wire.MsgTx) bool + func IsSStx(tx *wire.MsgTx) bool + func IsStakeBase(tx *wire.MsgTx) bool + func IsStakeChangeScript(version uint16, script []byte) bool + func IsStakeSubmissionTxOut(index int) bool + func IsTAdd(tx *wire.MsgTx) bool + func IsTSpend(tx *wire.MsgTx) bool + func IsTicketPurchaseScript(version uint16, script []byte) bool + func IsTreasuryBase(tx *wire.MsgTx) bool + func IsTreasuryVote(vote TreasuryVoteT) bool + func IsVoteScript(version uint16, script []byte) bool + func ResetDatabase(dbTx database.Tx, params StakeParams, genesisHash *chainhash.Hash) error + func SSGenBlockVotedOn(tx *wire.MsgTx) (chainhash.Hash, uint32) + func SSGenVersion(tx *wire.MsgTx) uint32 + func SSGenVoteBits(tx *wire.MsgTx) uint16 + func SStxNullOutputAmounts(amounts []int64, changeAmounts []int64, amountTicket int64) (int64, []int64, error) + func SStxStakeOutputInfo(outs []*MinimalOutput) ([]bool, [][]byte, []int64, []int64, [][]bool, [][]uint16) + func TxSStxStakeOutputInfo(tx *wire.MsgTx) ([]bool, [][]byte, []int64, []int64, [][]bool, [][]uint16) + func UseLogger(logger slog.Logger) + func WriteConnectedBestNode(dbTx database.Tx, node *Node, hash chainhash.Hash) error + func WriteDisconnectedBestNode(dbTx database.Tx, node *Node, hash chainhash.Hash, ...) error + type ErrorCode int + func (e ErrorCode) String() string + type Hash256PRNG struct + func NewHash256PRNG(seed []byte) *Hash256PRNG + func NewHash256PRNGFromIV(iv chainhash.Hash) *Hash256PRNG + func (hp *Hash256PRNG) Hash256Rand() uint32 + func (hp *Hash256PRNG) StateHash() chainhash.Hash + type MinimalOutput struct + PkScript []byte + Value int64 + Version uint16 + func ConvertToMinimalOutputs(tx *wire.MsgTx) []*MinimalOutput + type Node struct + func InitDatabaseState(dbTx database.Tx, params StakeParams, genesisHash *chainhash.Hash) (*Node, error) + func LoadBestNode(dbTx database.Tx, height uint32, blockHash chainhash.Hash, ...) (*Node, error) + func (sn *Node) ConnectNode(lotteryIV chainhash.Hash, ...) (*Node, error) + func (sn *Node) DisconnectNode(parentLotteryIV chainhash.Hash, parentUtds UndoTicketDataSlice, ...) (*Node, error) + func (sn *Node) ExistsExpiredTicket(ticket chainhash.Hash) bool + func (sn *Node) ExistsLiveTicket(ticket chainhash.Hash) bool + func (sn *Node) ExistsMissedTicket(ticket chainhash.Hash) bool + func (sn *Node) ExistsRevokedTicket(ticket chainhash.Hash) bool + func (sn *Node) ExpiredByBlock() []chainhash.Hash + func (sn *Node) FinalState() [6]byte + func (sn *Node) Height() uint32 + func (sn *Node) LiveTickets() []chainhash.Hash + func (sn *Node) MissedByBlock() []chainhash.Hash + func (sn *Node) MissedTickets() []chainhash.Hash + func (sn *Node) NewTickets() []chainhash.Hash + func (sn *Node) PoolSize() int + func (sn *Node) RevokedTickets() []*chainhash.Hash + func (sn *Node) SpentByBlock() []chainhash.Hash + func (sn *Node) UndoData() UndoTicketDataSlice + func (sn *Node) Winners() []chainhash.Hash + type RuleError struct + Description string + ErrorCode ErrorCode + func (e RuleError) Error() string + func (e RuleError) GetCode() ErrorCode + type SpentTicketsInBlock struct + RevokedTickets []chainhash.Hash + VotedTickets []chainhash.Hash + Votes []VoteVersionTuple + func FindSpentTicketsInBlock(block *wire.MsgBlock) *SpentTicketsInBlock + type StakeParams interface + StakeEnableHeight func() int64 + StakeValidationBeginHeight func() int64 + TicketExpiryBlocks func() uint32 + VotesPerBlock func() uint16 + type TreasuryVoteT byte + const TreasuryVoteInvalid + const TreasuryVoteNo + const TreasuryVoteYes + func CheckTreasuryVote(vote TreasuryVoteT) (TreasuryVoteT, error) + type TreasuryVoteTuple struct + Hash chainhash.Hash + Vote TreasuryVoteT + func CheckSSGenVotes(tx *wire.MsgTx, isTreasuryEnabled bool) ([]TreasuryVoteTuple, error) + func GetSSGenTreasuryVotes(PkScript []byte) ([]TreasuryVoteTuple, error) + type TxType int + const TxTypeRegular + const TxTypeSSGen + const TxTypeSSRtx + const TxTypeSStx + const TxTypeTAdd + const TxTypeTSpend + const TxTypeTreasuryBase + func DetermineTxType(tx *wire.MsgTx, isTreasuryEnabled bool) TxType + type UndoTicketDataSlice []ticketdb.UndoTicketData + type VoteBits struct + Bits uint16 + ExtendedBits []byte + type VoteVersionTuple struct + Bits uint16 + Version uint32 Other modules containing this package github.com/decred/dcrd/blockchain/stake github.com/decred/dcrd/blockchain/stake/v2 github.com/decred/dcrd/blockchain/stake/v4 github.com/decred/dcrd/blockchain/stake/v5