diff --git a/.gitignore b/.gitignore
index 4102cec3e..0e6907b4f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -89,4 +89,6 @@ android/key.properties
**/tool/.secrets-prod.json
**/lib/.secrets.g.dart
-vendor/
\ No newline at end of file
+vendor/
+
+android/app/.cxx/**
diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj
index 54901a5a7..34c4e48a4 100644
--- a/ios/Runner.xcodeproj/project.pbxproj
+++ b/ios/Runner.xcodeproj/project.pbxproj
@@ -373,7 +373,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
- CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
+ CURRENT_PROJECT_VERSION = 6;
DEVELOPMENT_TEAM = 32J6BB6VUS;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
@@ -387,7 +387,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
- MARKETING_VERSION = 3.1.28;
+ MARKETING_VERSION = 3.2.0;
PRODUCT_BUNDLE_IDENTIFIER = com.cakewallet.cakewallet;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
@@ -509,7 +509,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
- CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
+ CURRENT_PROJECT_VERSION = 6;
DEVELOPMENT_TEAM = 32J6BB6VUS;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
@@ -523,7 +523,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
- MARKETING_VERSION = 3.1.28;
+ MARKETING_VERSION = 3.2.0;
PRODUCT_BUNDLE_IDENTIFIER = com.cakewallet.cakewallet;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
@@ -540,7 +540,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
- CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
+ CURRENT_PROJECT_VERSION = 6;
DEVELOPMENT_TEAM = 32J6BB6VUS;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
@@ -554,7 +554,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
- MARKETING_VERSION = 3.1.28;
+ MARKETING_VERSION = 3.2.0;
PRODUCT_BUNDLE_IDENTIFIER = com.cakewallet.cakewallet;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist
index 40f292e53..0b40211a4 100644
--- a/ios/Runner/Info.plist
+++ b/ios/Runner/Info.plist
@@ -19,7 +19,7 @@
CFBundleSignature
????
CFBundleVersion
- $(FLUTTER_BUILD_NUMBER)
+ $(CURRENT_PROJECT_VERSION)
LSRequiresIPhoneOS
UILaunchStoryboardName
diff --git a/lib/bitcoin/bitcoin_address_record.dart b/lib/bitcoin/bitcoin_address_record.dart
index cd2e21495..98cd1c9da 100644
--- a/lib/bitcoin/bitcoin_address_record.dart
+++ b/lib/bitcoin/bitcoin_address_record.dart
@@ -1,17 +1,19 @@
import 'dart:convert';
class BitcoinAddressRecord {
- BitcoinAddressRecord(this.address, {this.label});
+ BitcoinAddressRecord(this.address, {this.label, this.index});
factory BitcoinAddressRecord.fromJSON(String jsonSource) {
final decoded = json.decode(jsonSource) as Map;
return BitcoinAddressRecord(decoded['address'] as String,
- label: decoded['label'] as String);
+ label: decoded['label'] as String, index: decoded['index'] as int);
}
final String address;
+ int index;
String label;
- String toJSON() => json.encode({'label': label, 'address': address});
+ String toJSON() =>
+ json.encode({'label': label, 'address': address, 'index': index});
}
diff --git a/lib/bitcoin/bitcoin_transaction_credentials.dart b/lib/bitcoin/bitcoin_transaction_credentials.dart
index 52f2d5ec6..874da1263 100644
--- a/lib/bitcoin/bitcoin_transaction_credentials.dart
+++ b/lib/bitcoin/bitcoin_transaction_credentials.dart
@@ -1,6 +1,9 @@
+import 'package:cake_wallet/src/domain/common/transaction_priority.dart';
+
class BitcoinTransactionCredentials {
- const BitcoinTransactionCredentials(this.address, this.amount);
+ BitcoinTransactionCredentials(this.address, this.amount, this.priority);
final String address;
final double amount;
+ TransactionPriority priority;
}
diff --git a/lib/bitcoin/bitcoin_transaction_history.dart b/lib/bitcoin/bitcoin_transaction_history.dart
index 1a3990bf7..4a18d18c1 100644
--- a/lib/bitcoin/bitcoin_transaction_history.dart
+++ b/lib/bitcoin/bitcoin_transaction_history.dart
@@ -6,8 +6,6 @@ import 'package:cake_wallet/bitcoin/file.dart';
import 'package:cake_wallet/bitcoin/bitcoin_wallet.dart';
import 'package:cake_wallet/bitcoin/bitcoin_transaction_info.dart';
import 'package:cake_wallet/bitcoin/electrum.dart';
-import 'package:cake_wallet/src/domain/common/transaction_info.dart';
-import 'package:cake_wallet/src/domain/common/transaction_direction.dart';
part 'bitcoin_transaction_history.g.dart';
@@ -24,100 +22,176 @@ abstract class BitcoinTransactionHistoryBase
{this.eclient, String dirPath, @required String password})
: path = '$dirPath/$_transactionsHistoryFileName',
_password = password,
- _height = 0;
+ _height = 0,
+ _isUpdating = false {
+ transactions = ObservableMap();
+ }
BitcoinWalletBase wallet;
final ElectrumClient eclient;
final String path;
final String _password;
int _height;
+ bool _isUpdating;
Future init() async {
- final info = await _read();
- _height = info['height'] as int ?? _height;
- transactions = ObservableList.of(
- info['transactions'] as List ??
- []);
+ await _load();
}
@override
Future update() async {
- await super.update();
- _updateHeight();
+ if (_isUpdating) {
+ return;
+ }
+
+ try {
+ _isUpdating = true;
+ final txs = await fetchTransactions();
+ await add(txs);
+ _isUpdating = false;
+ } catch (_) {
+ _isUpdating = false;
+ rethrow;
+ }
}
@override
- Future> fetchTransactions() async {
- final addresses = wallet.addresses;
+ Future