filter out change address. Better refresh

This commit is contained in:
Matias Alejo Garcia 2014-04-17 17:22:50 -03:00
commit 5eca1a63c2
3 changed files with 13 additions and 12 deletions

View file

@ -192,16 +192,18 @@ PublicKeyRing.prototype.generateAddress = function(isChange) {
};
PublicKeyRing.prototype.getAddresses = function() {
PublicKeyRing.prototype.getAddresses = function(onlyMain) {
var ret = [];
for (var i=0; i<this.changeAddressIndex; i++) {
ret.push(this.getAddress(i,true));
}
for (var i=0; i<this.addressIndex; i++) {
ret.push(this.getAddress(i,false));
}
if (!onlyMain) {
for (var i=0; i<this.changeAddressIndex; i++) {
ret.push(this.getAddress(i,true));
}
}
return ret;
};