* feat: missing desktop setting menu

* fix: sp utxo pending
This commit is contained in:
Rafael 2024-05-31 08:55:28 -03:00 committed by GitHub
parent 96b9b60f50
commit 5545137047
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 21 additions and 3 deletions

View file

@ -1465,7 +1465,7 @@ abstract class ElectrumWalletBase
time = status["block_time"] as int?; time = status["block_time"] as int?;
final height = status["block_height"] as int? ?? 0; final height = status["block_height"] as int? ?? 0;
final tip = await getCurrentChainTip(); final tip = await getUpdatedChainTip();
if (tip > 0) confirmations = height > 0 ? tip - height + 1 : 0; if (tip > 0) confirmations = height > 0 ? tip - height + 1 : 0;
} else { } else {
final verboseTransaction = await electrumClient.getTransactionRaw(hash: hash); final verboseTransaction = await electrumClient.getTransactionRaw(hash: hash);
@ -1519,6 +1519,23 @@ abstract class ElectrumWalletBase
await fetchTransactionsForAddressType(historiesWithDetails, SegwitAddresType.p2wpkh); await fetchTransactionsForAddressType(historiesWithDetails, SegwitAddresType.p2wpkh);
} }
transactionHistory.transactions.values.forEach((tx) async {
final isPendingSilentPaymentUtxo =
(tx.isPending || tx.confirmations == 0) && historiesWithDetails[tx.id] == null;
if (isPendingSilentPaymentUtxo) {
final info =
await fetchTransactionInfo(hash: tx.id, height: tx.height, retryOnFailure: true);
if (info != null) {
tx.confirmations = info.confirmations;
tx.isPending = tx.confirmations == 0;
transactionHistory.addOne(tx);
await transactionHistory.save();
}
}
});
return historiesWithDetails; return historiesWithDetails;
} catch (e) { } catch (e) {
print(e.toString()); print(e.toString());

View file

@ -793,8 +793,8 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
path: "." path: "."
ref: "sp_v1.0.0" ref: "sp_v2.0.0"
resolved-ref: a9a4c6d051f37a15a3a52cc2a0094f24c68b62c5 resolved-ref: "62c152b9086cd968019128845371072f7e1168de"
url: "https://github.com/cake-tech/sp_scanner" url: "https://github.com/cake-tech/sp_scanner"
source: git source: git
version: "0.0.1" version: "0.0.1"

View file

@ -29,6 +29,7 @@ class SettingActions {
connectionSettingAction, connectionSettingAction,
walletSettingAction, walletSettingAction,
addressBookSettingAction, addressBookSettingAction,
silentPaymentsSettingAction,
securityBackupSettingAction, securityBackupSettingAction,
privacySettingAction, privacySettingAction,
displaySettingAction, displaySettingAction,