Browse Source

use walletName which is diff from wallet.getName()

master
Gaëtan Renaudeau 6 years ago
parent
commit
abf29dda63
No known key found for this signature in database GPG Key ID: 7B66B85F042E5451
  1. 18
      src/helpers/libcore.js

18
src/helpers/libcore.js

@ -164,6 +164,7 @@ async function scanAccountsOnDeviceBySegwit({
const accounts = await scanNextAccount({ const accounts = await scanNextAccount({
core, core,
wallet, wallet,
walletName,
devicePath, devicePath,
currencyId, currencyId,
accountsCount, accountsCount,
@ -241,6 +242,7 @@ const coreSyncAccount = (core, account) =>
async function scanNextAccount(props: { async function scanNextAccount(props: {
// $FlowFixMe // $FlowFixMe
wallet: NJSWallet, wallet: NJSWallet,
walletName: string,
core: *, core: *,
devicePath: string, devicePath: string,
currencyId: string, currencyId: string,
@ -256,6 +258,7 @@ async function scanNextAccount(props: {
const { const {
core, core,
wallet, wallet,
walletName,
devicePath, devicePath,
currencyId, currencyId,
accountsCount, accountsCount,
@ -294,6 +297,7 @@ async function scanNextAccount(props: {
isUnsplit, isUnsplit,
accountIndex, accountIndex,
wallet, wallet,
walletName,
currencyId, currencyId,
core, core,
ops, ops,
@ -368,6 +372,7 @@ async function buildAccountRaw({
isSegwit, isSegwit,
isUnsplit, isUnsplit,
wallet, wallet,
walletName,
currencyId, currencyId,
core, core,
accountIndex, accountIndex,
@ -377,6 +382,7 @@ async function buildAccountRaw({
isSegwit: boolean, isSegwit: boolean,
isUnsplit: boolean, isUnsplit: boolean,
wallet: NJSWallet, wallet: NJSWallet,
walletName: string,
currencyId: string, currencyId: string,
accountIndex: number, accountIndex: number,
core: *, core: *,
@ -441,7 +447,7 @@ async function buildAccountRaw({
type: 'libcore', type: 'libcore',
version: '1', version: '1',
xpub, xpub,
walletName: wallet.getName(), walletName,
}), }),
xpub, xpub,
path: walletPath, path: walletPath,
@ -522,15 +528,10 @@ export async function syncAccount({
index: number, index: number,
}) { }) {
const decodedAccountId = accountIdHelper.decode(accountId) const decodedAccountId = accountIdHelper.decode(accountId)
const { walletName } = decodedAccountId
const isSegwit = isSegwitPath(freshAddressPath) const isSegwit = isSegwitPath(freshAddressPath)
const isUnsplit = isUnsplitPath(freshAddressPath, SPLITTED_CURRENCIES[currencyId]) const isUnsplit = isUnsplitPath(freshAddressPath, SPLITTED_CURRENCIES[currencyId])
const njsWallet = await getOrCreateWallet( const njsWallet = await getOrCreateWallet(core, walletName, currencyId, isSegwit, isUnsplit)
core,
decodedAccountId.walletName,
currencyId,
isSegwit,
isUnsplit,
)
let njsAccount let njsAccount
try { try {
@ -563,6 +564,7 @@ export async function syncAccount({
isUnsplit, isUnsplit,
accountIndex: index, accountIndex: index,
wallet: njsWallet, wallet: njsWallet,
walletName,
currencyId, currencyId,
core, core,
ops, ops,

Loading…
Cancel
Save