aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib/idStore.js
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2016-09-13 06:25:36 +0800
committerkumavis <aaron@kumavis.me>2016-09-13 06:25:36 +0800
commit850b6d144092291bb80ad998d3f8177da9c98c13 (patch)
tree94666fa470c77971c56217e762fece18bf2e3edf /app/scripts/lib/idStore.js
parent2f289fb115f0b09ab7852b4c89b3c39c5bf6ec4e (diff)
parentb8f75e387a91135b870c9f268977445c8e0877a4 (diff)
downloadtangerine-wallet-browser-850b6d144092291bb80ad998d3f8177da9c98c13.tar
tangerine-wallet-browser-850b6d144092291bb80ad998d3f8177da9c98c13.tar.gz
tangerine-wallet-browser-850b6d144092291bb80ad998d3f8177da9c98c13.tar.bz2
tangerine-wallet-browser-850b6d144092291bb80ad998d3f8177da9c98c13.tar.lz
tangerine-wallet-browser-850b6d144092291bb80ad998d3f8177da9c98c13.tar.xz
tangerine-wallet-browser-850b6d144092291bb80ad998d3f8177da9c98c13.tar.zst
tangerine-wallet-browser-850b6d144092291bb80ad998d3f8177da9c98c13.zip
Merge branch 'master' of github.com:MetaMask/metamask-plugin into library
Diffstat (limited to 'app/scripts/lib/idStore.js')
-rw-r--r--app/scripts/lib/idStore.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/scripts/lib/idStore.js b/app/scripts/lib/idStore.js
index 7ac71e409..26aa02ef7 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)
@@ -437,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)
@@ -478,7 +483,7 @@ IdentityStore.prototype._restoreFromSeed = function (password, seed, derivedKey)
keyStore.addHdDerivationPath(this.hdPathString, derivedKey, {curve: 'secp256k1', purpose: 'sign'})
keyStore.setDefaultHdDerivationPath(this.hdPathString)
- keyStore.generateNewAddress(derivedKey, 3)
+ keyStore.generateNewAddress(derivedKey, 1)
configManager.setWallet(keyStore.serialize())
if (global.METAMASK_DEBUG) {
console.log('restored from seed. saved to keystore')