feat: reuse bip47 instance for faster address generation

This commit is contained in:
abhishandy 2022-12-14 22:39:07 -05:00
parent dc07637c3f
commit e0eed1cd6e

View File

@ -1494,8 +1494,7 @@ export class AbstractHDElectrumWallet extends AbstractHDWallet {
return this.addresses_by_payment_code[paymentCode][index];
}
const bip47 = BIP47Factory(ecc);
const bip47_instance = bip47.fromBip39Seed(this.secret, undefined, this.passphrase);
const bip47_instance = this.getBIP47FromSeed();
const senderBIP47_instance = bip47.fromPaymentCode(paymentCode);
const remotePaymentNode = senderBIP47_instance.getPaymentCodeNode();
const hdNode = bip47_instance.getPaymentWallet(remotePaymentNode, index);