ltx

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: 25 Imported by: 14

Documentation

Index

Constants

View Source
const (
	MaxScriptVerifyJobNum = 50000
)

Variables

This section is empty.

Functions

func ApplyBlockTransactions

func ApplyBlockTransactions(txs []*tx.Tx, bip30Enable bool, scriptCheckFlags uint32,
	needCheckScript bool, blockSubSidy amount.Amount, blockHeight int32, blockMaxSigOpsCount uint64,
	lockTimeFlags uint32, pindex *blockindex.BlockIndex) (coinMap *utxo.CoinsMap, bundo *undo.BlockUndo, err error)

func AreInputsStandard added in v0.0.3

func AreInputsStandard(transaction *tx.Tx, coinsMap *utxo.CoinsMap) bool

func CalculateLockPoints

func CalculateLockPoints(transaction *tx.Tx, flags uint32) (lp *mempool.LockPoints)

CalculateLockPoints calculate lockpoint(all ins' max time or height at which it can be spent) of transaction

func CalculateSequenceLocks

func CalculateSequenceLocks(transaction *tx.Tx, coinsMap *utxo.CoinsMap, flags uint32) (height int32, time int64)

func CheckBlockTransactions

func CheckBlockTransactions(txs []*tx.Tx, maxBlockSigOps uint64) error

CheckBlockTransactions block service use these 3 func to check transactions or to apply transaction while connecting block to active chain

func CheckInputsMoney

func CheckInputsMoney(transaction *tx.Tx, coinsMap *utxo.CoinsMap, spendHeight int32) (err error)

func CheckSequenceLocks

func CheckSequenceLocks(height int32, time int64) bool

func CheckTxBeforeAcceptToMemPool added in v0.0.3

func CheckTxBeforeAcceptToMemPool(txn *tx.Tx) (*mempool.TxEntry, error)

func CombineSignature

func CombineSignature(transaction *tx.Tx, prevPubKey *script.Script, scriptSig *script.Script,
	txOldScriptSig *script.Script, nIn int, money amount.Amount, flags uint32,
	scriptChecker lscript.Checker) (*script.Script, error)

func ContextualCheckTransaction

func ContextualCheckTransaction(txn *tx.Tx, nBlockHeight int32, nLockTimeCutoff, mediaTimePast int64) error

func ContextualCheckTransactionForCurrentBlock

func ContextualCheckTransactionForCurrentBlock(transaction *tx.Tx, flags int) error

func ContextureCheckBlockTransactions

func ContextureCheckBlockTransactions(txs []*tx.Tx, blockHeight int32, blockLockTime, mediaTimePast int64) error

func GetTransactionSigOpCount

func GetTransactionSigOpCount(txn *tx.Tx, flags uint32, coinMap *utxo.CoinsMap) int

func ScriptVerifyInit added in v0.0.3

func ScriptVerifyInit()

func TxAddCoins added in v0.0.4

func TxAddCoins(tx *tx.Tx, coinMap *utxo.CoinsMap, height int32)

func TxSpendCoins added in v0.0.4

func TxSpendCoins(tx *tx.Tx, coinMap *utxo.CoinsMap, txundo *undo.TxUndo)

Types

type ScriptVerifyJob added in v0.0.3

type ScriptVerifyJob struct {
	Tx                     *tx.Tx
	ScriptSig              *script.Script
	ScriptPubKey           *script.Script
	IputNum                int
	Value                  amount.Amount
	Flags                  uint32
	ScriptChecker          lscript.Checker
	ScriptVerifyResultChan chan ScriptVerifyResult
}

type ScriptVerifyResult added in v0.0.3

type ScriptVerifyResult struct {
	TxHash       util.Hash
	ScriptSig    *script.Script
	ScriptPubKey *script.Script
	InputNum     int
	Err          error
}

type SignError added in v0.0.3

type SignError struct {
	TxIn   *txin.TxIn
	ErrMsg string
}

func SignRawTransaction

func SignRawTransaction(transactions []*tx.Tx, redeemScripts map[outpoint.OutPoint]*script.Script,
	keyStore *crypto.KeyStore, coinsMap *utxo.CoinsMap, hashType uint32) []*SignError

Jump to

Keyboard shortcuts

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