hide mix failed after timeout

This commit is contained in:
Craig Raw 2022-10-26 12:40:17 +02:00
parent 97d121244f
commit ebb7d23a05

View file

@ -8,6 +8,7 @@ import com.sparrowwallet.sparrow.wallet.Entry;
import com.sparrowwallet.sparrow.wallet.UtxoEntry; import com.sparrowwallet.sparrow.wallet.UtxoEntry;
public class MixTableCell extends TableCell { public class MixTableCell extends TableCell {
private static final int ERROR_DISPLAY_MILLIS = 5 * 60 * 1000;
public static final int WIDTH = 18; public static final int WIDTH = 18;
public MixTableCell(Entry entry) { public MixTableCell(Entry entry) {
@ -41,7 +42,8 @@ public class MixTableCell extends TableCell {
} }
private String getMixFail(UtxoEntry.MixStatus mixStatus) { private String getMixFail(UtxoEntry.MixStatus mixStatus) {
if(mixStatus.getMixFailReason() == MixFailReason.CANCEL) { long elapsed = mixStatus.getMixErrorTimestamp() == null ? 0L : System.currentTimeMillis() - mixStatus.getMixErrorTimestamp();
if(mixStatus.getMixFailReason() == MixFailReason.CANCEL || elapsed >= ERROR_DISPLAY_MILLIS) {
return getMixCountOnly(mixStatus); return getMixCountOnly(mixStatus);
} }