Transaction: amend confusing exception message
This commit is contained in:
parent
c0e5393595
commit
c5252fc509
1 changed files with 2 additions and 2 deletions
|
@ -37,13 +37,13 @@ Transaction.prototype.addInput = function(tx, index) {
|
||||||
|
|
||||||
if (typeof tx === 'string') {
|
if (typeof tx === 'string') {
|
||||||
hash = new Buffer(tx, 'hex')
|
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
|
// TxHash hex is big-endian, we need little-endian
|
||||||
Array.prototype.reverse.call(hash)
|
Array.prototype.reverse.call(hash)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
assert(tx instanceof Transaction, 'Expected Transaction, got ' + tx)
|
assert(tx instanceof Transaction, 'Expected Transaction or string, got ' + tx)
|
||||||
hash = crypto.hash256(tx.toBuffer())
|
hash = crypto.hash256(tx.toBuffer())
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue