From ea933e0474167e5f5fbec6b7326263fa62d32dfb Mon Sep 17 00:00:00 2001 From: julian Date: Mon, 20 Mar 2023 09:23:33 -0600 Subject: [PATCH] do not freeze notification tx change outputs --- lib/services/coins/bitcoin/bitcoin_wallet.dart | 6 ++++-- lib/services/coins/dogecoin/dogecoin_wallet.dart | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/services/coins/bitcoin/bitcoin_wallet.dart b/lib/services/coins/bitcoin/bitcoin_wallet.dart index acbfb16f2..3a9175d70 100644 --- a/lib/services/coins/bitcoin/bitcoin_wallet.dart +++ b/lib/services/coins/bitcoin/bitcoin_wallet.dart @@ -1842,6 +1842,7 @@ class BitcoinWallet extends CoinServiceAPI bool shouldBlock = false; String? blockReason; + String? label; if (storedTx?.subType == isar_models.TransactionSubType.bip47Notification) { @@ -1849,10 +1850,11 @@ class BitcoinWallet extends CoinServiceAPI shouldBlock = true; blockReason = "Incoming paynym notification transaction."; } else if (storedTx?.type == isar_models.TransactionType.outgoing) { - shouldBlock = true; + shouldBlock = false; blockReason = "Paynym notification change output. Incautious " "handling of change outputs from notification transactions " "may cause unintended loss of privacy."; + label = blockReason; } } @@ -1875,7 +1877,7 @@ class BitcoinWallet extends CoinServiceAPI txid: txn["txid"] as String, vout: vout, value: jsonUTXO["value"] as int, - name: "", + name: label ?? "", isBlocked: shouldBlock, blockedReason: blockReason, isCoinbase: txn["is_coinbase"] as bool? ?? false, diff --git a/lib/services/coins/dogecoin/dogecoin_wallet.dart b/lib/services/coins/dogecoin/dogecoin_wallet.dart index 240d303e9..8fb892609 100644 --- a/lib/services/coins/dogecoin/dogecoin_wallet.dart +++ b/lib/services/coins/dogecoin/dogecoin_wallet.dart @@ -1587,6 +1587,7 @@ class DogecoinWallet extends CoinServiceAPI bool shouldBlock = false; String? blockReason; + String? label; if (storedTx?.subType == isar_models.TransactionSubType.bip47Notification) { @@ -1594,10 +1595,11 @@ class DogecoinWallet extends CoinServiceAPI shouldBlock = true; blockReason = "Incoming paynym notification transaction."; } else if (storedTx?.type == isar_models.TransactionType.outgoing) { - shouldBlock = true; + shouldBlock = false; blockReason = "Paynym notification change output. Incautious " "handling of change outputs from notification transactions " "may cause unintended loss of privacy."; + label = blockReason; } } @@ -1620,7 +1622,7 @@ class DogecoinWallet extends CoinServiceAPI txid: txn["txid"] as String, vout: vout, value: jsonUTXO["value"] as int, - name: "", + name: label ?? "", isBlocked: shouldBlock, blockedReason: blockReason, isCoinbase: txn["is_coinbase"] as bool? ?? false,