mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-02-22 23:08:07 +01:00
Merge pull request #5378 from BlueWallet/fix-skip-faulty-bip47-notification-transactions
FIX: skip faulty bip47 notification transactions
This commit is contained in:
commit
7dd40a41da
1 changed files with 8 additions and 0 deletions
|
@ -1487,6 +1487,14 @@ export class AbstractHDElectrumWallet extends AbstractHDWallet {
|
|||
try {
|
||||
const paymentCode = bip47_instance.getPaymentCodeFromRawNotificationTransaction(txHex);
|
||||
if (this._sender_payment_codes.includes(paymentCode)) continue; // already have it
|
||||
|
||||
// final check if PC is even valid (could've been constructed by a buggy code, and our code would crash with that):
|
||||
try {
|
||||
BIP47Factory(ecc).fromPaymentCode(paymentCode);
|
||||
} catch (_) {
|
||||
continue;
|
||||
}
|
||||
|
||||
this._sender_payment_codes.push(paymentCode);
|
||||
this._next_free_payment_code_address_index[paymentCode] = 0; // initialize
|
||||
this._balances_by_payment_code_index[paymentCode] = { c: 0, u: 0 };
|
||||
|
|
Loading…
Add table
Reference in a new issue