mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-23 11:59:30 +00:00
refresh inscriptions if needed and add utility func
This commit is contained in:
parent
f32359ac1e
commit
abd4bf9d7a
2 changed files with 15 additions and 5 deletions
|
@ -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
|
||||
|
|
|
@ -91,4 +91,14 @@ mixin OrdinalsInterface {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// check if an inscription is in a given <UTXO> output
|
||||
Future<bool> inscriptionInAddresses(List<String> addresses) async {
|
||||
var inscriptions = await _getInscriptionDataFromAddresses(addresses);
|
||||
if (inscriptions.isNotEmpty) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue