Skip to content

Commit d2f99c9

Browse files
committed
clean up txv2
1 parent be51789 commit d2f99c9

1 file changed

Lines changed: 4 additions & 36 deletions

File tree

lib/models/isar/models/blockchain_data/v2/transaction_v2.dart

Lines changed: 4 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -271,40 +271,6 @@ class TransactionV2 {
271271
return "Restored Funds";
272272
}
273273

274-
if (isCancelled) {
275-
return "Cancelled";
276-
} else if (type == TransactionType.incoming) {
277-
if (isConfirmed(currentChainHeight, minConfirms, minCoinbaseConfirms)) {
278-
return "Received";
279-
} else {
280-
if (numberOfMessages == 1) {
281-
return "Receiving (waiting for sender)";
282-
} else if ((numberOfMessages ?? 0) > 1) {
283-
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)
284-
} else {
285-
return "Receiving ${prettyConfirms()}";
286-
}
287-
}
288-
} else if (type == TransactionType.outgoing) {
289-
if (isConfirmed(currentChainHeight, minConfirms, minCoinbaseConfirms)) {
290-
return "Sent (confirmed)";
291-
} else {
292-
if (numberOfMessages == 1) {
293-
return "Sending (waiting for receiver)";
294-
} else if ((numberOfMessages ?? 0) > 1) {
295-
return "Sending (waiting for confirmations)";
296-
} else {
297-
return "Sending ${prettyConfirms()}";
298-
}
299-
}
300-
}
301-
}
302-
303-
if (isMimblewimblecoinTransaction) {
304-
if (slateId == null) {
305-
return "Restored Funds";
306-
}
307-
308274
if (isCancelled) {
309275
return "Cancelled";
310276
} else if (type == TransactionType.incoming) {
@@ -347,7 +313,8 @@ class TransactionV2 {
347313
if (isConfirmed(currentChainHeight, minConfirms, minCoinbaseConfirms)) {
348314
return "Received";
349315
} else {
350-
if (numberOfMessages == 1) {
316+
if ((onChainNote == null && numberOfMessages == 1) |
317+
(onChainNote != null && numberOfMessages == 2)) {
351318
return "Receiving (waiting for sender)";
352319
} else if ((numberOfMessages ?? 0) > 1) {
353320
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 {
359326
if (isConfirmed(currentChainHeight, minConfirms, minCoinbaseConfirms)) {
360327
return "Sent (confirmed)";
361328
} else {
362-
if (numberOfMessages == 1) {
329+
if ((onChainNote == null && numberOfMessages == 1) |
330+
(onChainNote != null && numberOfMessages == 2)) {
363331
return "Sending (waiting for receiver)";
364332
} else if ((numberOfMessages ?? 0) > 1) {
365333
return "Sending (waiting for confirmations)";

0 commit comments

Comments
 (0)