assume mints listed in lelantus txs are confirmed

TODO make sure that mints/_mintTxnData only contains confirmed tx / filter unconfirmed
This commit is contained in:
sneurlax 2023-04-10 15:21:33 -05:00
parent 240f091892
commit 77b1e23144

View file

@ -900,6 +900,10 @@ class FiroWallet extends CoinServiceAPI
.findAll(); .findAll();
// _transactionData ??= _refreshTransactions(); // _transactionData ??= _refreshTransactions();
// Query for lelantus txs / mints
Future<List<isar_models.Transaction>> get _mintsTxnData =>
db.getTransactions(walletId).filter().isLelantusEqualTo(true).findAll();
// models.TransactionData? cachedTxData; // models.TransactionData? cachedTxData;
// hack to add tx to txData before refresh completes // hack to add tx to txData before refresh completes
@ -2385,6 +2389,7 @@ class FiroWallet extends CoinServiceAPI
} }
final jindexes = firoGetJIndex(); final jindexes = firoGetJIndex();
final transactions = await _txnData; final transactions = await _txnData;
final mints = await _mintsTxnData;
final lelantusTransactionsd = await db final lelantusTransactionsd = await db
.getTransactions(walletId) .getTransactions(walletId)
.filter() .filter()
@ -2413,7 +2418,9 @@ class FiroWallet extends CoinServiceAPI
if (!jindexes!.contains(lelantusCoinsList[i].index) && if (!jindexes!.contains(lelantusCoinsList[i].index) &&
transactions transactions
.where((e) => e.txid == lelantusCoinsList[i].txId) .where((e) => e.txid == lelantusCoinsList[i].txId)
.isEmpty) { .isEmpty &&
mints.where((e) => e.txid == lelantusCoinsList[i].txId).isEmpty) {
// TODO make sure that mints is filtered to remove unconfirmed tx
isUnconfirmed = true; isUnconfirmed = true;
} }