Skip to content

Commit

Permalink
fix(bch cache): get correct xpub for correct receive or change index
Browse files Browse the repository at this point in the history
  • Loading branch information
plondon committed Jun 11, 2021
1 parent 3363b91 commit 4b1629c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export const getNextAvailableChangeAddress = curry(
HDWallet.selectAccount(accountIndex),
walletSelectors.getDefaultHDWallet
)(state)
const xpub = HDAccount.selectXpub(account)
const xpub = HDAccount.selectXpub(account, 'legacy')
const index = getChangeIndex(xpub)(state)
return index.map(x =>
getAddress(network, `${accountIndex}/${1}/${x}`, state)
Expand All @@ -210,7 +210,7 @@ export const getNextAvailableReceiveAddress = curry(
HDWallet.selectAccount(accountIndex),
walletSelectors.getDefaultHDWallet
)(state)
const xpub = HDAccount.selectXpub(account)
const xpub = HDAccount.selectXpub(account, 'legacy')
const index = getReceiveIndex(xpub)(state)
return index.map(x =>
getAddress(network, `${accountIndex}/${0}/${x}`, state)
Expand Down

0 comments on commit 4b1629c

Please sign in to comment.