fix: more bch zero conf special case fixes

This commit is contained in:
julian 2023-05-08 16:15:39 -06:00
parent 88d0638b43
commit 2cf7d6de93
3 changed files with 18 additions and 10 deletions

View file

@ -94,7 +94,10 @@ class _TransactionsListState extends ConsumerState<TransactionsList> {
TransactionCard( TransactionCard(
// this may mess with combined firo transactions // this may mess with combined firo transactions
key: isConfirmed key: isConfirmed
? Key(tx.txid + tx.type.name + tx.address.value.toString()) ? Key(tx.txid +
tx.type.name +
tx.address.value.toString() +
tx.height.toString())
: UniqueKey(), // : UniqueKey(), //
transaction: tx, transaction: tx,
walletId: widget.walletId, walletId: widget.walletId,
@ -191,7 +194,10 @@ class _TransactionsListState extends ConsumerState<TransactionsList> {
child: TransactionCard( child: TransactionCard(
// this may mess with combined firo transactions // this may mess with combined firo transactions
key: isConfirmed key: isConfirmed
? Key(tx.txid + tx.type.name + tx.address.value.toString()) ? Key(tx.txid +
tx.type.name +
tx.address.value.toString() +
tx.height.toString())
: UniqueKey(), : UniqueKey(),
transaction: tx, transaction: tx,
walletId: widget.walletId, walletId: widget.walletId,

View file

@ -112,10 +112,11 @@ class _TransactionDetailsViewState
super.dispose(); super.dispose();
} }
String whatIsIt(TransactionType type, int height) { String whatIsIt(Transaction tx, int height) {
final type = tx.type;
if (coin == Coin.firo || coin == Coin.firoTestNet) { if (coin == Coin.firo || coin == Coin.firoTestNet) {
if (_transaction.subType == TransactionSubType.mint) { if (tx.subType == TransactionSubType.mint) {
if (_transaction.isConfirmed(height, coin.requiredConfirmations)) { if (tx.isConfirmed(height, coin.requiredConfirmations)) {
return "Minted"; return "Minted";
} else { } else {
return "Minting"; return "Minting";
@ -127,13 +128,13 @@ class _TransactionDetailsViewState
// if (_transaction.isMinting) { // if (_transaction.isMinting) {
// return "Minting"; // return "Minting";
// } else // } else
if (_transaction.isConfirmed(height, coin.requiredConfirmations)) { if (tx.isConfirmed(height, coin.requiredConfirmations)) {
return "Received"; return "Received";
} else { } else {
return "Receiving"; return "Receiving";
} }
} else if (type == TransactionType.outgoing) { } else if (type == TransactionType.outgoing) {
if (_transaction.isConfirmed(height, coin.requiredConfirmations)) { if (tx.isConfirmed(height, coin.requiredConfirmations)) {
return "Sent"; return "Sent";
} else { } else {
return "Sending"; return "Sending";
@ -428,7 +429,7 @@ class _TransactionDetailsViewState
_transaction.isCancelled _transaction.isCancelled
? "Cancelled" ? "Cancelled"
: whatIsIt( : whatIsIt(
_transaction.type, _transaction,
currentHeight, currentHeight,
), ),
style: style:
@ -545,7 +546,7 @@ class _TransactionDetailsViewState
_transaction.isCancelled _transaction.isCancelled
? "Cancelled" ? "Cancelled"
: whatIsIt( : whatIsIt(
_transaction.type, _transaction,
currentHeight, currentHeight,
), ),
style: isDesktop style: isDesktop

View file

@ -1958,7 +1958,8 @@ class BitcoinCashWallet extends CoinServiceAPI
if (storedTx == null || if (storedTx == null ||
storedTx.address.value == null || storedTx.address.value == null ||
storedTx.height == null storedTx.height == null ||
(storedTx.height != null && storedTx.height! <= 0)
// zero conf messes this up // zero conf messes this up
// !storedTx.isConfirmed(currentHeight, MINIMUM_CONFIRMATIONS) // !storedTx.isConfirmed(currentHeight, MINIMUM_CONFIRMATIONS)
) { ) {