Transaction: amend confusing exception message

This commit is contained in:
Daniel Cousens 2014-06-16 15:44:27 +10:00
parent c0e5393595
commit c5252fc509

View file

@ -37,13 +37,13 @@ Transaction.prototype.addInput = function(tx, index) {
if (typeof tx === 'string') {
hash = new Buffer(tx, 'hex')
assert.equal(hash.length, 32, 'Invalid TX hash')
assert.equal(hash.length, 32, 'Expected Transaction or string, got ' + tx)
// TxHash hex is big-endian, we need little-endian
Array.prototype.reverse.call(hash)
} else {
assert(tx instanceof Transaction, 'Expected Transaction, got ' + tx)
assert(tx instanceof Transaction, 'Expected Transaction or string, got ' + tx)
hash = crypto.hash256(tx.toBuffer())
}