mirror of
https://github.com/sparrowwallet/drongo.git
synced 2024-12-26 01:56:44 +00:00
fix for retreiving notification tx data for non-zero bip47 accounts
This commit is contained in:
parent
7bb07ab39e
commit
956f59880e
1 changed files with 3 additions and 1 deletions
|
@ -112,7 +112,9 @@ public class PaymentCode {
|
||||||
TransactionInput txInput = getDesignatedInput(transaction);
|
TransactionInput txInput = getDesignatedInput(transaction);
|
||||||
ECKey pubKey = getDesignatedPubKey(txInput);
|
ECKey pubKey = getDesignatedPubKey(txInput);
|
||||||
|
|
||||||
ECKey notificationPrivKey = keystore.getBip47ExtendedPrivateKey().getKey(List.of(ChildNumber.ZERO_HARDENED, new ChildNumber(0)));
|
List<ChildNumber> derivation = keystore.getKeyDerivation().getDerivation();
|
||||||
|
ChildNumber derivationStart = derivation.isEmpty() ? ChildNumber.ZERO_HARDENED : derivation.get(derivation.size() - 1);
|
||||||
|
ECKey notificationPrivKey = keystore.getBip47ExtendedPrivateKey().getKey(List.of(derivationStart, new ChildNumber(0)));
|
||||||
SecretPoint secretPoint = new SecretPoint(notificationPrivKey.getPrivKeyBytes(), pubKey.getPubKey());
|
SecretPoint secretPoint = new SecretPoint(notificationPrivKey.getPrivKeyBytes(), pubKey.getPubKey());
|
||||||
byte[] blindingMask = getMask(secretPoint.ECDHSecretAsBytes(), txInput.getOutpoint().bitcoinSerialize());
|
byte[] blindingMask = getMask(secretPoint.ECDHSecretAsBytes(), txInput.getOutpoint().bitcoinSerialize());
|
||||||
byte[] blindedPaymentCode = getOpReturnData(transaction);
|
byte[] blindedPaymentCode = getOpReturnData(transaction);
|
||||||
|
|
Loading…
Reference in a new issue