add validation for actual tx SIGHASH_TYPE

This commit is contained in:
Manuel Araoz 2014-07-24 18:07:22 -03:00
commit 76e0d8f5ef
2 changed files with 61 additions and 0 deletions

View file

@ -60,6 +60,13 @@ TxProposal.prototype.isValid = function() {
if (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) {
return false;
}
}
return true;
};