mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-17 09:47:37 +00:00
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:
parent
240f091892
commit
77b1e23144
1 changed files with 8 additions and 1 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue