fix cases for incomplete transactions

This commit is contained in:
Manuel Araoz 2014-07-25 13:37:12 -03:00
commit e85431861e
3 changed files with 20 additions and 3 deletions

View file

@ -57,13 +57,13 @@ TxProposal.fromObj = function(o) {
TxProposal.prototype.isValid = function() {
if (this.builder.signhash !== Transaction.SIGHASH_ALL) {
if (this.builder.signhash && this.builder.signhash !== Transaction.SIGHASH_ALL) {
return false;
}
var tx = this.builder.build();
for (var i = 0; i < tx.ins.length; i++) {
var hashType = tx.getHashType(i);
if (hashType !== Transaction.SIGHASH_ALL) {
if (hashType && hashType !== Transaction.SIGHASH_ALL) {
return false;
}
}