aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib/idStore.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-08-30 07:14:51 +0800
committerDan Finlay <dan@danfinlay.com>2016-08-30 07:14:51 +0800
commite85418b11ad14bf6f0cc3fdbcdbb5669330c4778 (patch)
treedf71d73fa1533cea8b36fb24db90e02a07766607 /app/scripts/lib/idStore.js
parent40d5b446cfbea436a012d1799d0d7710caca752c (diff)
parenta9c738d4d3226f61942641a41c399c75a3e9eb3e (diff)
downloadtangerine-wallet-browser-e85418b11ad14bf6f0cc3fdbcdbb5669330c4778.tar
tangerine-wallet-browser-e85418b11ad14bf6f0cc3fdbcdbb5669330c4778.tar.gz
tangerine-wallet-browser-e85418b11ad14bf6f0cc3fdbcdbb5669330c4778.tar.bz2
tangerine-wallet-browser-e85418b11ad14bf6f0cc3fdbcdbb5669330c4778.tar.lz
tangerine-wallet-browser-e85418b11ad14bf6f0cc3fdbcdbb5669330c4778.tar.xz
tangerine-wallet-browser-e85418b11ad14bf6f0cc3fdbcdbb5669330c4778.tar.zst
tangerine-wallet-browser-e85418b11ad14bf6f0cc3fdbcdbb5669330c4778.zip
Merge branch 'master' into EdgeCompatibility
Diffstat (limited to 'app/scripts/lib/idStore.js')
-rw-r--r--app/scripts/lib/idStore.js18
1 files changed, 15 insertions, 3 deletions
diff --git a/app/scripts/lib/idStore.js b/app/scripts/lib/idStore.js
index c6ac55a03..0f36a520b 100644
--- a/app/scripts/lib/idStore.js
+++ b/app/scripts/lib/idStore.js
@@ -45,7 +45,11 @@ function IdentityStore (opts = {}) {
IdentityStore.prototype.createNewVault = function (password, entropy, cb) {
delete this._keyStore
+ var serializedKeystore = this.configManager.getWallet()
+ if (serializedKeystore) {
+ this.configManager.setData({})
+ }
this._createIdmgmt(password, null, entropy, (err) => {
if (err) return cb(err)
@@ -100,6 +104,10 @@ IdentityStore.prototype.getState = function () {
unconfMsgs: messageManager.unconfirmedMsgs(),
messages: messageManager.getMsgList(),
selectedAddress: configManager.getSelectedAccount(),
+ shapeShiftTxList: configManager.getShapeShiftTxList(),
+ currentFiat: configManager.getCurrentFiat(),
+ conversionRate: configManager.getConversionRate(),
+ conversionDate: configManager.getConversionDate(),
}))
}
@@ -153,8 +161,9 @@ IdentityStore.prototype.getNetwork = function (err) {
this._currentState.network = 'loading'
return this._didUpdate()
}
-
- console.log('web3.getNetwork returned ' + network)
+ if (global.METAMASK_DEBUG) {
+ console.log('web3.getNetwork returned ' + network)
+ }
this._currentState.network = network
this._didUpdate()
})
@@ -432,6 +441,7 @@ IdentityStore.prototype.tryPassword = function (password, cb) {
IdentityStore.prototype._createIdmgmt = function (password, seed, entropy, cb) {
const configManager = this.configManager
+
var keyStore = null
LightwalletKeyStore.deriveKeyFromPassword(password, (err, derivedKey) => {
if (err) return cb(err)
@@ -475,7 +485,9 @@ IdentityStore.prototype._restoreFromSeed = function (password, seed, derivedKey)
keyStore.generateNewAddress(derivedKey, 3)
configManager.setWallet(keyStore.serialize())
- console.log('restored from seed. saved to keystore')
+ if (global.METAMASK_DEBUG) {
+ console.log('restored from seed. saved to keystore')
+ }
return keyStore
}