TxBuilder: add more failing cases and error handling

This commit is contained in:
Daniel Cousens 2014-08-30 14:35:46 +10:00
parent e1479b6fa5
commit 1d0fd3e9a4
3 changed files with 25 additions and 1 deletions

View file

@ -34,6 +34,10 @@ TransactionBuilder.fromTransaction = function(transaction) {
// Ignore empty scripts
if (txin.script.buffer.length === 0) return
assert(!Array.prototype.every.call(txin.hash, function(x) {
return x === 0
}), 'coinbase inputs not supported')
var redeemScript
var scriptSig = txin.script
var scriptType = scripts.classifyInput(scriptSig)
@ -83,7 +87,7 @@ TransactionBuilder.fromTransaction = function(transaction) {
break
default:
assert(false, scriptType + ' not supported')
assert(false, scriptType + ' inputs not supported')
}
txb.signatures[i] = {