wallet fixes.
This commit is contained in:
parent
13ee6a5751
commit
434fdc7a78
@ -90,7 +90,7 @@ function Wallet(options) {
|
||||
this.id = this.getID();
|
||||
|
||||
// Non-alphanumeric IDs will break leveldb sorting.
|
||||
if (!/^[a-zA-Z0-9]$/.test(this.id))
|
||||
if (!/^[a-zA-Z0-9]+$/.test(this.id))
|
||||
throw new Error('Wallet IDs must be alphanumeric.');
|
||||
|
||||
this.addKey(this.accountKey);
|
||||
@ -323,10 +323,12 @@ Wallet.prototype.createAddress = function createAddress(change) {
|
||||
address = this.deriveChange(this.changeDepth);
|
||||
this.deriveChange(this.changeDepth + this.lookahead);
|
||||
this.changeDepth++;
|
||||
this.changeAddress = address;
|
||||
} else {
|
||||
address = this.deriveReceive(this.receiveDepth);
|
||||
this.deriveReceive(this.receiveDepth + this.lookahead);
|
||||
this.receiveDepth++;
|
||||
this.receiveAddress = address;
|
||||
}
|
||||
|
||||
return address;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user