TxBuilder: throw on keyPair network inconsistency

This commit is contained in:
Daniel Cousens 2015-08-07 16:54:22 +10:00
parent 2971816588
commit 1e90e1620a

View file

@ -282,6 +282,7 @@ TransactionBuilder.prototype.__build = function (allowIncomplete) {
}
TransactionBuilder.prototype.sign = function (index, keyPair, redeemScript, hashType) {
assert.equal(keyPair.network, this.network, 'Inconsistent network')
assert(index in this.inputs, 'No input at index: ' + index)
hashType = hashType || Transaction.SIGHASH_ALL