mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 20:39:51 +00:00
Sp fixes (#1487)
* feat: missing desktop setting menu * fix: sp utxo pending * fix: change to electrs only scanning, initial migration, and btc-electrum as null ssl
This commit is contained in:
parent
30dc8f9238
commit
1dd2c7da56
6 changed files with 67 additions and 30 deletions
|
@ -197,7 +197,7 @@ abstract class ElectrumWalletBase
|
|||
bool silentPaymentsScanningActive = false;
|
||||
|
||||
@action
|
||||
Future<void> setSilentPaymentsScanning(bool active) async {
|
||||
Future<void> setSilentPaymentsScanning(bool active, bool usingElectrs) async {
|
||||
silentPaymentsScanningActive = active;
|
||||
|
||||
if (active) {
|
||||
|
@ -210,7 +210,11 @@ abstract class ElectrumWalletBase
|
|||
}
|
||||
|
||||
if (tip > walletInfo.restoreHeight) {
|
||||
_setListeners(walletInfo.restoreHeight, chainTipParam: _currentChainTip);
|
||||
_setListeners(
|
||||
walletInfo.restoreHeight,
|
||||
chainTipParam: _currentChainTip,
|
||||
usingElectrs: usingElectrs,
|
||||
);
|
||||
}
|
||||
} else {
|
||||
alwaysScan = false;
|
||||
|
@ -277,7 +281,12 @@ abstract class ElectrumWalletBase
|
|||
}
|
||||
|
||||
@action
|
||||
Future<void> _setListeners(int height, {int? chainTipParam, bool? doSingleScan}) async {
|
||||
Future<void> _setListeners(
|
||||
int height, {
|
||||
int? chainTipParam,
|
||||
bool? doSingleScan,
|
||||
bool? usingElectrs,
|
||||
}) async {
|
||||
final chainTip = chainTipParam ?? await getUpdatedChainTip();
|
||||
|
||||
if (chainTip == height) {
|
||||
|
@ -303,7 +312,7 @@ abstract class ElectrumWalletBase
|
|||
chainTip: chainTip,
|
||||
electrumClient: ElectrumClient(),
|
||||
transactionHistoryIds: transactionHistory.transactions.keys.toList(),
|
||||
node: ScanNode(node!.uri, node!.useSSL),
|
||||
node: usingElectrs == true ? ScanNode(node!.uri, node!.useSSL) : null,
|
||||
labels: walletAddresses.labels,
|
||||
labelIndexes: walletAddresses.silentAddresses
|
||||
.where((addr) => addr.type == SilentPaymentsAddresType.p2sp && addr.index >= 1)
|
||||
|
@ -1122,8 +1131,13 @@ abstract class ElectrumWalletBase
|
|||
|
||||
@action
|
||||
@override
|
||||
Future<void> rescan(
|
||||
{required int height, int? chainTip, ScanData? scanData, bool? doSingleScan}) async {
|
||||
Future<void> rescan({
|
||||
required int height,
|
||||
int? chainTip,
|
||||
ScanData? scanData,
|
||||
bool? doSingleScan,
|
||||
bool? usingElectrs,
|
||||
}) async {
|
||||
silentPaymentsScanningActive = true;
|
||||
_setListeners(height, doSingleScan: doSingleScan);
|
||||
}
|
||||
|
@ -1820,7 +1834,7 @@ class ScanData {
|
|||
final SendPort sendPort;
|
||||
final SilentPaymentOwner silentAddress;
|
||||
final int height;
|
||||
final ScanNode node;
|
||||
final ScanNode? node;
|
||||
final BasedUtxoNetwork network;
|
||||
final int chainTip;
|
||||
final ElectrumClient electrumClient;
|
||||
|
@ -1881,7 +1895,10 @@ Future<void> startRefresh(ScanData scanData) async {
|
|||
scanData.sendPort.send(SyncResponse(syncHeight, syncingStatus));
|
||||
|
||||
final electrumClient = scanData.electrumClient;
|
||||
await electrumClient.connectToUri(scanData.node.uri, useSSL: scanData.node.useSSL);
|
||||
await electrumClient.connectToUri(
|
||||
scanData.node?.uri ?? Uri.parse("tcp://electrs.cakewallet.com:50001"),
|
||||
useSSL: scanData.node?.useSSL ?? false,
|
||||
);
|
||||
|
||||
if (tweaksSubscription == null) {
|
||||
final count = scanData.isSingleScan ? 1 : TWEAKS_COUNT;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue