add preconditions to Structure.js

This commit is contained in:
Manuel Araoz 2014-06-24 14:40:03 -03:00
commit 2bf8ac912f
6 changed files with 22 additions and 27 deletions

View file

@ -190,7 +190,7 @@ PublicKeyRing.prototype.getScriptPubKeyHex = function(index, isChange) {
//generate a new address, update index.
PublicKeyRing.prototype.generateAddress = function(isChange) {
isChange = !!isChange;
var index = isChange ? this.indexes.getChangeIndex() : this.indexes.getReceiveIndex();
var ret = this.getAddress(index, isChange);
this.indexes.increment(isChange);