diff --git a/src/transaction.js b/src/transaction.js index 51cfd00..65c0a59 100644 --- a/src/transaction.js +++ b/src/transaction.js @@ -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()) }