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) CalculateModifiedSize() uint32
- func (tx *Tx) CheckCoinbaseTransaction() error
- func (tx *Tx) CheckDuplicateIns(outpoints *map[outpoint.OutPoint]bool) error
- func (tx *Tx) CheckRegularTransaction() error
- func (tx *Tx) CheckStandard() error
- func (tx *Tx) ComputePriority(priorityInputs float64, txSize int) float64
- 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() 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) IsCoinBase() bool
- func (tx *Tx) IsCommitment(data []byte) bool
- func (tx *Tx) IsFinal(Height int32, time int64) bool
- func (tx *Tx) RemoveTxIn(txIn *txin.TxIn)
- func (tx *Tx) RemoveTxOut(txOut *txout.TxOut)
- func (tx *Tx) Serialize(writer io.Writer) error
- func (tx *Tx) SerializeSize() uint32
- func (tx *Tx) SignStep(redeemScripts map[string]string, keys map[string]*crypto.PrivateKey, ...) (sigData [][]byte, pubKeyType int, 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) CalculateModifiedSize ¶
func (*Tx) CheckCoinbaseTransaction ¶
func (*Tx) CheckDuplicateIns ¶
func (*Tx) CheckRegularTransaction ¶
func (*Tx) CheckStandard ¶
func (*Tx) ComputePriority ¶
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) IsCommitment ¶
func (*Tx) IsFinal ¶
IsFinal proceeds as follows 1. tx.locktime > 0 and tx.locktime < Threshhold, use height to check(tx.locktime > current height) 2. tx.locktime > Threshhold, use time to check(tx.locktime > current blocktime) 3. sequence can disable it
func (*Tx) RemoveTxIn ¶
func (*Tx) RemoveTxOut ¶
func (*Tx) SerializeSize ¶
Click to show internal directories.
Click to hide internal directories.