src/wallet: getNextAddresss: add new address if necessary
This commit is contained in:
parent
3445ae2a36
commit
ef903bae07
1 changed files with 4 additions and 6 deletions
|
@ -95,13 +95,11 @@ Bitcoin.Wallet = (function () {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.getNextAddress = function () {
|
this.getNextAddress = function () {
|
||||||
if (keys.length) {
|
this.addressPointer++;
|
||||||
// TODO: Create new addresses if we run out
|
if(!keys[this.addressPointer]) {
|
||||||
this.addressPointer = (this.addressPointer + 1) % keys.length;
|
this.generateAddress();
|
||||||
return keys[this.addressPointer].getBitcoinAddress();
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
return keys[this.addressPointer].getBitcoinAddress();
|
||||||
};
|
};
|
||||||
|
|
||||||
this.signWithKey = function (pubKeyHash, hash) {
|
this.signWithKey = function (pubKeyHash, hash) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue