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:
parent
b04b4c27ea
commit
e54fb96d80
1 changed files with 1 additions and 1 deletions
|
@ -604,7 +604,7 @@ func CheckTransactionInputs(tx *btcwire.MsgTx, txHeight int64, txStore TxStore)
|
||||||
// Ensure the input is available.
|
// Ensure the input is available.
|
||||||
txInHash := &txIn.PreviousOutpoint.Hash
|
txInHash := &txIn.PreviousOutpoint.Hash
|
||||||
originTx, exists := txStore[*txInHash]
|
originTx, exists := txStore[*txInHash]
|
||||||
if !exists {
|
if !exists || originTx.Err != nil || originTx.Tx == nil {
|
||||||
str := fmt.Sprintf("unable to find input transaction "+
|
str := fmt.Sprintf("unable to find input transaction "+
|
||||||
"%v for transaction %v", txInHash, txHash)
|
"%v for transaction %v", txInHash, txHash)
|
||||||
return 0, RuleError(str)
|
return 0, RuleError(str)
|
||||||
|
|
Loading…
Add table
Reference in a new issue