diff --git a/lib/services/coins/litecoin/litecoin_wallet.dart b/lib/services/coins/litecoin/litecoin_wallet.dart index 4698883f8..ff36bc5c6 100644 --- a/lib/services/coins/litecoin/litecoin_wallet.dart +++ b/lib/services/coins/litecoin/litecoin_wallet.dart @@ -1891,7 +1891,6 @@ class LitecoinWallet extends CoinServiceAPI // TODO check the specific output, not just the address in general // TODO optimize by querying the litescribe API for all addresses at once, instead of one API call per output if (utxoOwnerAddress != null) { - // TODO add inscription to database if (await inscriptionInAddress(utxoOwnerAddress!)) { shouldBlock = true; blockReason = "Ordinal"; @@ -1927,15 +1926,16 @@ class LitecoinWallet extends CoinServiceAPI } } - if (inscriptionsRefreshNeeded) { - await refreshInscriptions(); - } - Logging.instance.log( 'Outputs fetched: $outputArray', level: LogLevel.Info, ); + // TODO replace with refreshInscriptions if outputs are changed + if (inscriptionsRefreshNeeded) { + await refreshInscriptions(); + } + await db.updateUTXOs(walletId, outputArray); // finally update balance diff --git a/lib/services/mixins/ordinals_interface.dart b/lib/services/mixins/ordinals_interface.dart index 5b17f3b48..f25508517 100644 --- a/lib/services/mixins/ordinals_interface.dart +++ b/lib/services/mixins/ordinals_interface.dart @@ -91,4 +91,14 @@ mixin OrdinalsInterface { return false; } } + + // check if an inscription is in a given output + Future inscriptionInAddresses(List addresses) async { + var inscriptions = await _getInscriptionDataFromAddresses(addresses); + if (inscriptions.isNotEmpty) { + return true; + } else { + return false; + } + } }