Export ValdiateTransactionScript function.
This function allows the caller to execute and validate all scripts for the passed transaction (which includes signature verification).
This commit is contained in:
parent
3c7511a34b
commit
baa4c36618
1 changed files with 4 additions and 4 deletions
|
@ -60,9 +60,9 @@ func validateTxIn(txInIdx int, txin *btcwire.TxIn, txSha *btcwire.ShaHash, tx *b
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// validateAllTxIn validates the scripts for the passed transaction using
|
// ValidateTransactionScripts validates the scripts for the passed transaction
|
||||||
// multiple goroutines.
|
// using multiple goroutines.
|
||||||
func validateAllTxIn(tx *btcwire.MsgTx, txHash *btcwire.ShaHash, timestamp time.Time, txStore TxStore) (err error) {
|
func ValidateTransactionScripts(tx *btcwire.MsgTx, txHash *btcwire.ShaHash, timestamp time.Time, txStore TxStore) (err error) {
|
||||||
c := make(chan txValidate)
|
c := make(chan txValidate)
|
||||||
job := tx.TxIn
|
job := tx.TxIn
|
||||||
resultErrors := make([]error, len(job))
|
resultErrors := make([]error, len(job))
|
||||||
|
@ -126,7 +126,7 @@ func checkBlockScripts(block *btcutil.Block, txStore TxStore) error {
|
||||||
timestamp := block.MsgBlock().Header.Timestamp
|
timestamp := block.MsgBlock().Header.Timestamp
|
||||||
for i, tx := range block.MsgBlock().Transactions {
|
for i, tx := range block.MsgBlock().Transactions {
|
||||||
txHash, _ := block.TxSha(i)
|
txHash, _ := block.TxSha(i)
|
||||||
err := validateAllTxIn(tx, txHash, timestamp, txStore)
|
err := ValidateTransactionScripts(tx, txHash, timestamp, txStore)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue