Test tx lookup validity in CheckInputTransactions.

This commit modifies CheckInputTransactions to ensure that not only must a
transaction exist in the transaction store, it must also not have any
errors associated with it or be nil.
This commit is contained in:
Dave Collins 2013-10-02 10:26:44 -05:00
parent b04b4c27ea
commit e54fb96d80

View file

@ -604,7 +604,7 @@ func CheckTransactionInputs(tx *btcwire.MsgTx, txHeight int64, txStore TxStore)
// Ensure the input is available.
txInHash := &txIn.PreviousOutpoint.Hash
originTx, exists := txStore[*txInHash]
if !exists {
if !exists || originTx.Err != nil || originTx.Tx == nil {
str := fmt.Sprintf("unable to find input transaction "+
"%v for transaction %v", txInHash, txHash)
return 0, RuleError(str)