aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/keyrings
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-12-09 06:22:02 +0800
committerDan Finlay <dan@danfinlay.com>2016-12-09 06:22:02 +0800
commitab9e15b782620002c0a2477829db3e56a25a7d5c (patch)
treef35f27db6ecd1dc04649a4d9c13625580e4b98e5 /app/scripts/keyrings
parent9e3fa3cfba20299413df87d18158180c7798d2ac (diff)
downloadtangerine-wallet-browser-ab9e15b782620002c0a2477829db3e56a25a7d5c.tar.gz
tangerine-wallet-browser-ab9e15b782620002c0a2477829db3e56a25a7d5c.tar.zst
tangerine-wallet-browser-ab9e15b782620002c0a2477829db3e56a25a7d5c.zip
Mostly added bad account detection
Currently riddled with logs, because the migrator is inexplicably returning before generating the new style accounts for comparison.
Diffstat (limited to 'app/scripts/keyrings')
-rw-r--r--app/scripts/keyrings/hd.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/scripts/keyrings/hd.js b/app/scripts/keyrings/hd.js
index cfec56561..55c008601 100644
--- a/app/scripts/keyrings/hd.js
+++ b/app/scripts/keyrings/hd.js
@@ -38,16 +38,18 @@ class HdKeyring extends EventEmitter {
}
if ('numberOfAccounts' in opts) {
- this.addAccounts(opts.numberOfAccounts)
+ console.log('number of accounts detected, adding accounts.')
+ return this.addAccounts(opts.numberOfAccounts)
}
- return Promise.resolve()
+ return Promise.resolve([])
}
addAccounts (numberOfAccounts = 1) {
if (!this.root) {
this._initFromMnemonic(bip39.generateMnemonic())
}
+ console.log('attempting to add %s accounts', numberOfAccounts)
const oldLen = this.wallets.length
const newWallets = []
@@ -57,7 +59,9 @@ class HdKeyring extends EventEmitter {
newWallets.push(wallet)
this.wallets.push(wallet)
}
+ console.log('hd has %s wallets', this.wallets.length)
const hexWallets = newWallets.map(w => w.getAddress().toString('hex'))
+ console.log('hd calling back w promise of hex wallets ' + hexWallets)
return Promise.resolve(hexWallets)
}