do not freeze notification tx change outputs

This commit is contained in:
julian 2023-03-20 09:23:33 -06:00
parent f580a2af78
commit ea933e0474
2 changed files with 8 additions and 4 deletions

View file

@ -1842,6 +1842,7 @@ class BitcoinWallet extends CoinServiceAPI
bool shouldBlock = false; bool shouldBlock = false;
String? blockReason; String? blockReason;
String? label;
if (storedTx?.subType == if (storedTx?.subType ==
isar_models.TransactionSubType.bip47Notification) { isar_models.TransactionSubType.bip47Notification) {
@ -1849,10 +1850,11 @@ class BitcoinWallet extends CoinServiceAPI
shouldBlock = true; shouldBlock = true;
blockReason = "Incoming paynym notification transaction."; blockReason = "Incoming paynym notification transaction.";
} else if (storedTx?.type == isar_models.TransactionType.outgoing) { } else if (storedTx?.type == isar_models.TransactionType.outgoing) {
shouldBlock = true; shouldBlock = false;
blockReason = "Paynym notification change output. Incautious " blockReason = "Paynym notification change output. Incautious "
"handling of change outputs from notification transactions " "handling of change outputs from notification transactions "
"may cause unintended loss of privacy."; "may cause unintended loss of privacy.";
label = blockReason;
} }
} }
@ -1875,7 +1877,7 @@ class BitcoinWallet extends CoinServiceAPI
txid: txn["txid"] as String, txid: txn["txid"] as String,
vout: vout, vout: vout,
value: jsonUTXO["value"] as int, value: jsonUTXO["value"] as int,
name: "", name: label ?? "",
isBlocked: shouldBlock, isBlocked: shouldBlock,
blockedReason: blockReason, blockedReason: blockReason,
isCoinbase: txn["is_coinbase"] as bool? ?? false, isCoinbase: txn["is_coinbase"] as bool? ?? false,

View file

@ -1587,6 +1587,7 @@ class DogecoinWallet extends CoinServiceAPI
bool shouldBlock = false; bool shouldBlock = false;
String? blockReason; String? blockReason;
String? label;
if (storedTx?.subType == if (storedTx?.subType ==
isar_models.TransactionSubType.bip47Notification) { isar_models.TransactionSubType.bip47Notification) {
@ -1594,10 +1595,11 @@ class DogecoinWallet extends CoinServiceAPI
shouldBlock = true; shouldBlock = true;
blockReason = "Incoming paynym notification transaction."; blockReason = "Incoming paynym notification transaction.";
} else if (storedTx?.type == isar_models.TransactionType.outgoing) { } else if (storedTx?.type == isar_models.TransactionType.outgoing) {
shouldBlock = true; shouldBlock = false;
blockReason = "Paynym notification change output. Incautious " blockReason = "Paynym notification change output. Incautious "
"handling of change outputs from notification transactions " "handling of change outputs from notification transactions "
"may cause unintended loss of privacy."; "may cause unintended loss of privacy.";
label = blockReason;
} }
} }
@ -1620,7 +1622,7 @@ class DogecoinWallet extends CoinServiceAPI
txid: txn["txid"] as String, txid: txn["txid"] as String,
vout: vout, vout: vout,
value: jsonUTXO["value"] as int, value: jsonUTXO["value"] as int,
name: "", name: label ?? "",
isBlocked: shouldBlock, isBlocked: shouldBlock,
blockedReason: blockReason, blockedReason: blockReason,
isCoinbase: txn["is_coinbase"] as bool? ?? false, isCoinbase: txn["is_coinbase"] as bool? ?? false,