Fixes: open wallet livenet in testnet mode and viceversa when importing a backup
This commit is contained in:
parent
2340552437
commit
89b69e5d0a
1 changed files with 3 additions and 3 deletions
|
|
@ -53,7 +53,10 @@ WalletFactory.prototype.fromObj = function(obj) {
|
||||||
obj.opts.reconnectDelay = this.walletDefaults.reconnectDelay;
|
obj.opts.reconnectDelay = this.walletDefaults.reconnectDelay;
|
||||||
|
|
||||||
var w = Wallet.fromObj(obj, this.storage, this.network, this.blockchain);
|
var w = Wallet.fromObj(obj, this.storage, this.network, this.blockchain);
|
||||||
|
if (!w) return false;
|
||||||
w.verbose = this.verbose;
|
w.verbose = this.verbose;
|
||||||
|
this._checkVersion(w.version);
|
||||||
|
this._checkNetwork(w.getNetworkName());
|
||||||
return w;
|
return w;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -62,7 +65,6 @@ WalletFactory.prototype.fromEncryptedObj = function(base64, password) {
|
||||||
var walletObj = this.storage.import(base64);
|
var walletObj = this.storage.import(base64);
|
||||||
if (!walletObj) return false;
|
if (!walletObj) return false;
|
||||||
var w = this.fromObj(walletObj);
|
var w = this.fromObj(walletObj);
|
||||||
if (!w) return false;
|
|
||||||
return w;
|
return w;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -165,8 +167,6 @@ WalletFactory.prototype.open = function(walletId, opts) {
|
||||||
|
|
||||||
var w = this.read(walletId);
|
var w = this.read(walletId);
|
||||||
if (w) {
|
if (w) {
|
||||||
this._checkVersion(w.version);
|
|
||||||
this._checkNetwork(w.getNetworkName());
|
|
||||||
w.store();
|
w.store();
|
||||||
}
|
}
|
||||||
return w;
|
return w;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue