From 6645febe368fad496a814cccbbd74035b656fddf Mon Sep 17 00:00:00 2001 From: likho Date: Thu, 16 Feb 2023 13:41:09 +0200 Subject: [PATCH] Fix cancel error --- .../coins/epiccash/epiccash_wallet.dart | 45 ------------------- lib/utilities/default_nodes.dart | 2 +- 2 files changed, 1 insertion(+), 46 deletions(-) diff --git a/lib/services/coins/epiccash/epiccash_wallet.dart b/lib/services/coins/epiccash/epiccash_wallet.dart index f0a10dfdb..2e31196dd 100644 --- a/lib/services/coins/epiccash/epiccash_wallet.dart +++ b/lib/services/coins/epiccash/epiccash_wallet.dart @@ -423,46 +423,6 @@ class EpicCashWallet extends CoinServiceAPI late SecureStorageInterface _secureStore; Future cancelPendingTransactionAndPost(String txSlateId) async { - final wallet = await _secureStore.read(key: '${_walletId}_wallet'); - final int? receivingIndex = epicGetReceivingIndex(); - final epicboxConfig = - await _secureStore.read(key: '${_walletId}_epicboxConfig'); - - final slatesToCommits = await getSlatesToCommits(); - final receiveAddress = slatesToCommits[txSlateId]['to'] as String; - final sendersAddress = slatesToCommits[txSlateId]['from'] as String; - - int? currentReceivingIndex; - for (int i = 0; i <= receivingIndex!; i++) { - final indexesAddress = await _getReceivingAddressForIndex(i); - if (indexesAddress.value == sendersAddress) { - currentReceivingIndex = i; - break; - } - } - - dynamic subscribeRequest; - await m.protect(() async { - ReceivePort receivePort = await getIsolate({ - "function": "subscribeRequest", - "wallet": wallet, - "secretKeyIndex": currentReceivingIndex!, - "epicboxConfig": epicboxConfig, - }, name: walletName); - - var result = await receivePort.first; - if (result is String) { - Logging.instance.log("this is a message $result", level: LogLevel.Info); - stop(receivePort); - throw Exception("subscribeRequest isolate failed"); - } - subscribeRequest = jsonDecode(result['result'] as String); - stop(receivePort); - Logging.instance.log('Closing subscribeRequest! $subscribeRequest', - level: LogLevel.Info); - }); - // TODO, once server adds signature, give this signature to the getSlates method. - String? signature = subscribeRequest['signature'] as String?; String? result; try { result = await cancelPendingTransaction(txSlateId); @@ -1425,10 +1385,6 @@ class EpicCashWallet extends CoinServiceAPI return; } - // await listenForSlates(); - // await processAllSlates(); - // await processAllCancels(); - unawaited(startSync()); GlobalEventBus.instance.fire(RefreshPercentChangedEvent(0.0, walletId)); @@ -1465,7 +1421,6 @@ class EpicCashWallet extends CoinServiceAPI ), ); refreshMutex = false; - // await listenForSlates(); if (shouldAutoSync) { timer ??= Timer.periodic(const Duration(seconds: 60), (timer) async { Logging.instance.log( diff --git a/lib/utilities/default_nodes.dart b/lib/utilities/default_nodes.dart index 6e8cc53cb..83f6b9556 100644 --- a/lib/utilities/default_nodes.dart +++ b/lib/utilities/default_nodes.dart @@ -257,7 +257,7 @@ abstract class DefaultNodes { } static final String defaultEpicBoxConfig = jsonEncode({ - "epicbox_domain": "epicbox.epic.tech", + "epicbox_domain": "epicbox.fastepic.eu", "epicbox_port": 443, "epicbox_protocol_unsecure": false, "epicbox_address_index": 0,