Skip to content

Commit

Permalink
refactor '_getHDNodeForAddress' to support change addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
alejoacosta74 committed Jun 14, 2024
1 parent 0f483c5 commit fff7127
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/wallet/hdwallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@ export abstract class AbstractHDWallet {
if (!accountNode) {
throw new Error(`Account ${addressInfo.account} not found`);
}
const changeNode = accountNode.deriveChild(0);
const changeIndex = addressInfo.change ? 1 : 0;
const changeNode = accountNode.deriveChild(changeIndex);
return changeNode.deriveChild(addressInfo.index);
}

Expand Down

0 comments on commit fff7127

Please sign in to comment.