From baa4c366188d82f3255e8c5a719fb7d1249bffa2 Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Mon, 30 Sep 2013 16:47:37 -0500 Subject: [PATCH] Export ValdiateTransactionScript function. This function allows the caller to execute and validate all scripts for the passed transaction (which includes signature verification). --- scriptval.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scriptval.go b/scriptval.go index e4335110..b1d13036 100644 --- a/scriptval.go +++ b/scriptval.go @@ -60,9 +60,9 @@ func validateTxIn(txInIdx int, txin *btcwire.TxIn, txSha *btcwire.ShaHash, tx *b return nil } -// validateAllTxIn validates the scripts for the passed transaction using -// multiple goroutines. -func validateAllTxIn(tx *btcwire.MsgTx, txHash *btcwire.ShaHash, timestamp time.Time, txStore TxStore) (err error) { +// ValidateTransactionScripts validates the scripts for the passed transaction +// using multiple goroutines. +func ValidateTransactionScripts(tx *btcwire.MsgTx, txHash *btcwire.ShaHash, timestamp time.Time, txStore TxStore) (err error) { c := make(chan txValidate) job := tx.TxIn resultErrors := make([]error, len(job)) @@ -126,7 +126,7 @@ func checkBlockScripts(block *btcutil.Block, txStore TxStore) error { timestamp := block.MsgBlock().Header.Timestamp for i, tx := range block.MsgBlock().Transactions { txHash, _ := block.TxSha(i) - err := validateAllTxIn(tx, txHash, timestamp, txStore) + err := ValidateTransactionScripts(tx, txHash, timestamp, txStore) if err != nil { return err }