diff --git a/src/wallet/hdwallet.ts b/src/wallet/hdwallet.ts index 9a399220..764bdee9 100644 --- a/src/wallet/hdwallet.ts +++ b/src/wallet/hdwallet.ts @@ -244,7 +244,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); }