There was an error while loading. Please reload this page.
1 parent 3445ae2 commit ef903baCopy full SHA for ef903ba
src/wallet.js
@@ -95,13 +95,11 @@ Bitcoin.Wallet = (function () {
95
};
96
97
this.getNextAddress = function () {
98
- if (keys.length) {
99
- // TODO: Create new addresses if we run out
100
- this.addressPointer = (this.addressPointer + 1) % keys.length;
101
- return keys[this.addressPointer].getBitcoinAddress();
102
- } else {
103
- return null;
+ this.addressPointer++;
+ if(!keys[this.addressPointer]) {
+ this.generateAddress();
104
}
+ return keys[this.addressPointer].getBitcoinAddress();
105
106
107
this.signWithKey = function (pubKeyHash, hash) {
0 commit comments