Skip to content

Commit

Permalink
Improve double spend error strings.
Browse files Browse the repository at this point in the history
The error message now includes both the previous tx hash and output
index, rather than simply the transaction with the already spent
output.
  • Loading branch information
jrick committed Jan 7, 2015
1 parent 6af9302 commit 8945620
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -701,8 +701,7 @@ func CheckTransactionInputs(tx *btcutil.Tx, txHeight int64, txStore TxStore) (in
}
if originTx.Spent[originTxIndex] {
str := fmt.Sprintf("transaction %v tried to double "+
"spend coins from transaction %v", txHash,
txInHash)
"spend output %v", txHash, txIn.PreviousOutPoint)
return 0, ruleError(ErrDoubleSpend, str)
}

Expand Down

0 comments on commit 8945620

Please sign in to comment.