show sent to self jmint transactions correctly

This commit is contained in:
julian 2023-07-25 20:48:03 -06:00
parent 57839c2d18
commit 7b8f26206e

View file

@ -3538,11 +3538,21 @@ class FiroWallet extends CoinServiceAPI
), ),
); );
} }
final txid = txObject["txid"] as String;
const subType = isar_models.TransactionSubType.join; const subType = isar_models.TransactionSubType.join;
final type = nonWalletAddressFoundInOutputs final type = nonWalletAddressFoundInOutputs
? isar_models.TransactionType.outgoing ? isar_models.TransactionType.outgoing
: isar_models.TransactionType.incoming; : (await db.isar.lelantusCoins
.where()
.walletIdEqualTo(walletId)
.filter()
.txidEqualTo(txid)
.findFirst()) ==
null
? isar_models.TransactionType.incoming
: isar_models.TransactionType.sentToSelf;
final amount = nonWalletAddressFoundInOutputs final amount = nonWalletAddressFoundInOutputs
? totalOutputValue ? totalOutputValue
@ -3569,7 +3579,7 @@ class FiroWallet extends CoinServiceAPI
final tx = isar_models.Transaction( final tx = isar_models.Transaction(
walletId: walletId, walletId: walletId,
txid: txObject["txid"] as String, txid: txid,
timestamp: txObject["blocktime"] as int? ?? timestamp: txObject["blocktime"] as int? ??
(DateTime.now().millisecondsSinceEpoch ~/ 1000), (DateTime.now().millisecondsSinceEpoch ~/ 1000),
type: type, type: type,