What changed, and why it matters
This commit tidies up a Dart file that decides what text label to show for cryptocurrency transactions (for example, 'Received', 'Sending', or 'Cancelled'). It removes a large block of duplicated code and changes the logic that decides when a transaction is 'waiting for sender' or 'waiting for receiver' so it also considers whether an optional on-chain note is present. The change is a code cleanup with a small logic adjustment; there is no direct evidence it fixes a security vulnerability.
Treat as routine code maintenance. Review the use of single-pipe '|' to confirm it was intentional and does not reduce readability; consider replacing with '||' for clarity. No security patch urgency is indicated by the diff alone.
Security signals we found
Logic change in transaction state display conditions
Use of bitwise OR ('|') instead of logical OR ('||') in boolean expressions
Removal of duplicated code branch
Evidence from the diff
In lib/models/isar/models/blockchain_data/v2/transaction_v2.dart, the patch deletes a duplicated Mimblewimblecoin-specific branch and merges its logic into the remaining branch. It then adjusts the message-count checks for incoming/outgoing unconfirmed transactions: when an onChainNote exists, the code now expects numberOfMessages == 2 instead of 1 before reporting ‘waiting for sender/receiver’. The operator used is a single pipe ‘|’ (bitwise OR) rather than a logical ‘||’, which is unusual but functionally equivalent for boolean operands in Dart. No cryptographic, authentication, or storage-safety changes are visible.
Changed components
lib/models/isar/models/blockchain_data/v2/transaction_v2.dartTransaction status/label rendering for Mimblewimblecoin transactionsInspect captured patch +4 / −36
diff --git a/lib/models/isar/models/blockchain_data/v2/transaction_v2.dart b/lib/models/isar/models/blockchain_data/v2/transaction_v2.dart
index 927c1fa..721d9a1 100644
--- a/lib/models/isar/models/blockchain_data/v2/transaction_v2.dart
+++ b/lib/models/isar/models/blockchain_data/v2/transaction_v2.dart
@@ -271,40 +271,6 @@ class TransactionV2 {
return "Restored Funds";
}
- if (isCancelled) {
- return "Cancelled";
- } else if (type == TransactionType.incoming) {
- if (isConfirmed(currentChainHeight, minConfirms, minCoinbaseConfirms)) {
- return "Received";
- } else {
- if (numberOfMessages == 1) {
- return "Receiving (waiting for sender)";
- } else if ((numberOfMessages ?? 0) > 1) {
- return "Receiving (waiting for confirmations)"; // TODO test if the sender still has to open again after the receiver has 2 messages present, ie. sender->receiver->sender->node (yes) vs. sender->receiver->node (no)
- } else {
- return "Receiving ${prettyConfirms()}";
- }
- }
- } else if (type == TransactionType.outgoing) {
- if (isConfirmed(currentChainHeight, minConfirms, minCoinbaseConfirms)) {
- return "Sent (confirmed)";
- } else {
- if (numberOfMessages == 1) {
- return "Sending (waiting for receiver)";
- } else if ((numberOfMessages ?? 0) > 1) {
- return "Sending (waiting for confirmations)";
- } else {
- return "Sending ${prettyConfirms()}";
- }
- }
- }
- }
-
- if (isMimblewimblecoinTransaction) {
- if (slateId == null) {
- return "Restored Funds";
- }
-
if (isCancelled) {
return "Cancelled";
} else if (type == TransactionType.incoming) {
@@ -347,7 +313,8 @@ class TransactionV2 {
if (isConfirmed(currentChainHeight, minConfirms, minCoinbaseConfirms)) {
return "Received";
} else {
- if (numberOfMessages == 1) {
+ if ((onChainNote == null && numberOfMessages == 1) |
+ (onChainNote != null && numberOfMessages == 2)) {
return "Receiving (waiting for sender)";
} else if ((numberOfMessages ?? 0) > 1) {
return "Receiving (waiting for confirmations)"; // TODO test if the sender still has to open again after the receiver has 2 messages present, ie. sender->receiver->sender->node (yes) vs. sender->receiver->node (no)
@@ -359,7 +326,8 @@ class TransactionV2 {
if (isConfirmed(currentChainHeight, minConfirms, minCoinbaseConfirms)) {
return "Sent (confirmed)";
} else {
- if (numberOfMessages == 1) {
+ if ((onChainNote == null && numberOfMessages == 1) |
+ (onChainNote != null && numberOfMessages == 2)) {
return "Sending (waiting for receiver)";
} else if ((numberOfMessages ?? 0) > 1) {
return "Sending (waiting for confirmations)";
Why this scored 16/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.