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(
// this may mess with combined firo transactions
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(), //
transaction: tx,
walletId: widget.walletId,
@ -191,7 +194,10 @@ class _TransactionsListState extends ConsumerState<TransactionsList> {
child: TransactionCard(
// this may mess with combined firo transactions
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(),
transaction: tx,
walletId: widget.walletId,

View file

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

View file

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