Documentation ¶
Index ¶
- Constants
- func CheckSig(signHash util.Hash, vchSigIn []byte, vchPubKey []byte) bool
- func GetOutputsHash(outs []*txout.TxOut) (h util.Hash, err error)
- func GetPreviousOutHash(tx *Tx) (h util.Hash)
- func GetSequenceHash(tx *Tx) (h util.Hash)
- func SignatureHash(transaction *Tx, s *script.Script, hashType uint32, nIn int, ...) (result util.Hash, err error)
- type Tx
- func (tx *Tx) AddTxIn(txIn *txin.TxIn)
- func (tx *Tx) AddTxOut(txOut *txout.TxOut)
- func (tx *Tx) AnyInputTxIn(container map[util.Hash]struct{}) bool
- func (tx *Tx) CheckCoinbaseTransaction() error
- func (tx *Tx) CheckRegularTransaction() error
- func (tx *Tx) CheckRegularTransactionWhenNewBlock(outPoints map[outpoint.OutPoint]bool) error
- func (tx *Tx) Decode(reader io.Reader) error
- func (tx *Tx) Encode(writer io.Writer) error
- func (tx *Tx) EncodeSize() uint32
- func (tx *Tx) GetAllPreviousOut() (outs []outpoint.OutPoint)
- func (tx *Tx) GetHash() util.Hash
- func (tx *Tx) GetIns() []*txin.TxIn
- func (tx *Tx) GetInsCount() int
- func (tx *Tx) GetLockTime() uint32
- func (tx *Tx) GetOuts() []*txout.TxOut
- func (tx *Tx) GetOutsCount() int
- func (tx *Tx) GetSigOpCountWithoutP2SH(flags uint32) int
- func (tx *Tx) GetTxIn(index int) (out *txin.TxIn)
- func (tx *Tx) GetTxOut(index int) (out *txout.TxOut)
- func (tx *Tx) GetValueOut() amount.Amount
- func (tx *Tx) GetVersion() int32
- func (tx *Tx) InsertTxOut(pos int, txOut *txout.TxOut)
- func (tx *Tx) IsCoinBase() bool
- func (tx *Tx) IsFinal(Height int32, time int64) bool
- func (tx *Tx) IsStandard() (bool, string)
- func (tx *Tx) PrevoutHashs() (outs []util.Hash)
- func (tx *Tx) Serialize(writer io.Writer) error
- func (tx *Tx) SerializeSize() uint32
- func (tx *Tx) SignStep(nIn int, keyStore *crypto.KeyStore, redeemScript *script.Script, ...) (sigData [][]byte, err error)
- func (tx *Tx) String() string
- func (tx *Tx) Unserialize(reader io.Reader) error
- func (tx *Tx) UpdateInScript(i int, scriptSig *script.Script) error
Constants ¶
View Source
const ( TxOrphan = iota TxInvalid CoinAmount = 100000000 )
View Source
const ( RequireStandard = 1 DefaultVersion = 0x01 )
View Source
const ( MaxMoney = 21000000 * CoinAmount // MaxTxSigOpsCounts the maximum allowed number of signature check operations per transaction (network rule) MaxTxSigOpsCounts = 20000 FreeListMaxItems = 12500 MaxMessagePayload = 32 * 1024 * 1024 MinTxInPayload = 9 + util.Hash256Size MaxTxInPerMessage = (MaxMessagePayload / MinTxInPayload) + 1 TxVersion = 1 )
View Source
const ( DefaultBlockPriorityPercentage int64 = 5 MaxStandardVersion = 2 /*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(consensus.MaxTxSigOpsCount / 5) // DefaultIncrementalRelayFee is default for -incrementalrelayfee, which sets the minimum feerate increase // for mempool limiting or BIP 125 replacement DefaultIncrementalRelayFee int64 = 1000 // DefaultBytesPerSigop is default for -bytespersigop DefaultBytesPerSigop uint = 20 // MaxStandardP2WSHStackItems is the maximum number of witness stack items in a standard P2WSH script MaxStandardP2WSHStackItems uint = 100 /*MaxStandardP2WSHStackItemSize the maximum size of each witness stack item in a standard P2WSH script */ MaxStandardP2WSHStackItemSize uint = 80 /*MaxStandardP2WSHScriptSize the maximum size of a standard witnessScript */ MaxStandardP2WSHScriptSize uint = 3600 /*StandardLockTimeVerifyFlags used as the flags parameter to sequence and LockTime checks in * non-core code. */ StandardLockTimeVerifyFlags uint = consensus.LocktimeVerifySequence | consensus.LocktimeMedianTimePast )
Variables ¶
This section is empty.
Functions ¶
func GetPreviousOutHash ¶
func GetSequenceHash ¶
Types ¶
type Tx ¶
type Tx struct {
// contains filtered or unexported fields
}
func NewEmptyTx ¶
func NewEmptyTx() *Tx
func NewGenesisCoinbaseTx ¶
func NewGenesisCoinbaseTx() *Tx
func (*Tx) AnyInputTxIn ¶ added in v0.0.3
func (*Tx) CheckCoinbaseTransaction ¶
func (*Tx) CheckRegularTransaction ¶
func (*Tx) CheckRegularTransactionWhenNewBlock ¶ added in v0.0.4
func (*Tx) EncodeSize ¶
func (*Tx) GetAllPreviousOut ¶
func (*Tx) GetInsCount ¶
func (*Tx) GetLockTime ¶
func (*Tx) GetOutsCount ¶
func (*Tx) GetSigOpCountWithoutP2SH ¶
func (*Tx) GetValueOut ¶
func (*Tx) GetVersion ¶
func (*Tx) IsCoinBase ¶
func (*Tx) IsFinal ¶
IsFinal proceeds as follows 1. tx.locktime > 0 and tx.locktime < Threshold, use height to check final (tx.locktime < current height) 2. tx.locktime > Threshold, use time to check final (tx.locktime < current blocktime) 3. sequence can disable it(sequence == sequencefinal)
func (*Tx) IsStandard ¶ added in v0.0.3
func (*Tx) PrevoutHashs ¶ added in v0.0.3
func (*Tx) SerializeSize ¶
Click to show internal directories.
Click to hide internal directories.