mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-11-16 17:27:37 +00:00
Sp fixes (#1471)
* feat: missing desktop setting menu * fix: sp utxo pending
This commit is contained in:
parent
96b9b60f50
commit
5545137047
3 changed files with 21 additions and 3 deletions
|
@ -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());
|
||||||
|
|
|
@ -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"
|
||||||
|
|
|
@ -29,6 +29,7 @@ class SettingActions {
|
||||||
connectionSettingAction,
|
connectionSettingAction,
|
||||||
walletSettingAction,
|
walletSettingAction,
|
||||||
addressBookSettingAction,
|
addressBookSettingAction,
|
||||||
|
silentPaymentsSettingAction,
|
||||||
securityBackupSettingAction,
|
securityBackupSettingAction,
|
||||||
privacySettingAction,
|
privacySettingAction,
|
||||||
displaySettingAction,
|
displaySettingAction,
|
||||||
|
|
Loading…
Reference in a new issue