diff --git a/ios/Podfile.lock b/ios/Podfile.lock
index 6a82e887f..79d95f132 100644
--- a/ios/Podfile.lock
+++ b/ios/Podfile.lock
@@ -1237,6 +1237,8 @@ PODS:
- React-Core
- RNCPicker (2.6.1):
- React-Core
+ - RNDeviceInfo (11.1.0):
+ - React-Core
- RNFS (2.20.0):
- React-Core
- RNGestureHandler (2.16.2):
@@ -1406,6 +1408,7 @@ DEPENDENCIES:
- "RNCClipboard (from `../node_modules/@react-native-clipboard/clipboard`)"
- "RNCMaskedView (from `../node_modules/@react-native-masked-view/masked-view`)"
- "RNCPicker (from `../node_modules/@react-native-picker/picker`)"
+ - RNDeviceInfo (from `../node_modules/react-native-device-info`)
- RNFS (from `../node_modules/react-native-fs`)
- RNGestureHandler (from `../node_modules/react-native-gesture-handler`)
- RNKeychain (from `../node_modules/react-native-keychain`)
@@ -1585,6 +1588,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/@react-native-masked-view/masked-view"
RNCPicker:
:path: "../node_modules/@react-native-picker/picker"
+ RNDeviceInfo:
+ :path: "../node_modules/react-native-device-info"
RNFS:
:path: "../node_modules/react-native-fs"
RNGestureHandler:
@@ -1691,6 +1696,7 @@ SPEC CHECKSUMS:
RNCClipboard: 0a720adef5ec193aa0e3de24c3977222c7e52a37
RNCMaskedView: 090213d32d8b3bb83a4dcb7d12c18f0152591906
RNCPicker: b18aaf30df596e9b1738e7c1f9ee55402a229dca
+ RNDeviceInfo: b899ce37a403a4dea52b7cb85e16e49c04a5b88e
RNFS: 4ac0f0ea233904cb798630b3c077808c06931688
RNGestureHandler: 2282cfbcf86c360d29f44ace393203afd5c6cff7
RNKeychain: ff836453cba46938e0e9e4c22e43d43fa2c90333
diff --git a/ios/zeus.xcodeproj/project.pbxproj b/ios/zeus.xcodeproj/project.pbxproj
index d15c946fd..6539500ce 100644
--- a/ios/zeus.xcodeproj/project.pbxproj
+++ b/ios/zeus.xcodeproj/project.pbxproj
@@ -1494,6 +1494,7 @@
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-zeus-zeusTests/Pods-zeus-zeusTests-resources.sh",
"${PODS_CONFIGURATION_BUILD_DIR}/RNCAsyncStorage/RNCAsyncStorage_resources.bundle",
+ "${PODS_CONFIGURATION_BUILD_DIR}/RNDeviceInfo/RNDeviceInfoPrivacyInfo.bundle",
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/AntDesign.ttf",
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Entypo.ttf",
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/EvilIcons.ttf",
@@ -1516,6 +1517,7 @@
name = "[CP] Copy Pods Resources";
outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RNCAsyncStorage_resources.bundle",
+ "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RNDeviceInfoPrivacyInfo.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AntDesign.ttf",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Entypo.ttf",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/EvilIcons.ttf",
@@ -1565,6 +1567,7 @@
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-zeus/Pods-zeus-resources.sh",
"${PODS_CONFIGURATION_BUILD_DIR}/RNCAsyncStorage/RNCAsyncStorage_resources.bundle",
+ "${PODS_CONFIGURATION_BUILD_DIR}/RNDeviceInfo/RNDeviceInfoPrivacyInfo.bundle",
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/AntDesign.ttf",
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Entypo.ttf",
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/EvilIcons.ttf",
@@ -1587,6 +1590,7 @@
name = "[CP] Copy Pods Resources";
outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RNCAsyncStorage_resources.bundle",
+ "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RNDeviceInfoPrivacyInfo.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AntDesign.ttf",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Entypo.ttf",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/EvilIcons.ttf",
diff --git a/ios/zeus/PrivacyInfo.xcprivacy b/ios/zeus/PrivacyInfo.xcprivacy
index 41b8317f0..73661ec65 100644
--- a/ios/zeus/PrivacyInfo.xcprivacy
+++ b/ios/zeus/PrivacyInfo.xcprivacy
@@ -12,6 +12,14 @@
C617.1
+
+ NSPrivacyAccessedAPIType
+ NSPrivacyAccessedAPICategorySystemBootTime
+ NSPrivacyAccessedAPITypeReasons
+
+ 35F9.1
+
+
NSPrivacyAccessedAPIType
NSPrivacyAccessedAPICategoryUserDefaults
@@ -22,10 +30,10 @@
NSPrivacyAccessedAPIType
- NSPrivacyAccessedAPICategorySystemBootTime
+ NSPrivacyAccessedAPICategoryDiskSpace
NSPrivacyAccessedAPITypeReasons
- 35F9.1
+ 85F4.1
diff --git a/package.json b/package.json
index 974f327a6..2e210e8dd 100644
--- a/package.json
+++ b/package.json
@@ -101,6 +101,7 @@
"react-native-circular-progress-indicator": "4.4.2",
"react-native-crypto": "2.2.0",
"react-native-date-picker": "4.3.3",
+ "react-native-device-info": "11.1.0",
"react-native-draglist": "3.5.1",
"react-native-elements": "3.4.3",
"react-native-encrypted-storage": "4.0.3",
diff --git a/utils/LndMobileUtils.ts b/utils/LndMobileUtils.ts
index 2da1a4380..3b53ebd1d 100644
--- a/utils/LndMobileUtils.ts
+++ b/utils/LndMobileUtils.ts
@@ -4,6 +4,7 @@ import {
NativeModules,
Platform
} from 'react-native';
+import DeviceInfo from 'react-native-device-info';
import { generateSecureRandom } from 'react-native-securerandom';
import NetInfo from '@react-native-community/netinfo';
@@ -38,6 +39,10 @@ export const NEUTRINO_PING_OPTIMAL_MS = 200;
export const NEUTRINO_PING_LAX_MS = 500;
export const NEUTRINO_PING_THRESHOLD_MS = 1000;
+// ~4GB
+const NEUTRINO_PERSISTENT_FILTER_THRESHOLD = 402653183;
+
+
export const LndMobileEventEmitter =
Platform.OS == 'android'
? DeviceEventEmitter
@@ -88,7 +93,15 @@ const writeLndConfig = async (
? 'connect'
: 'addpeer';
- const config = `[Application Options]
+ DeviceInfo.getTotalMemory().then(async (totalMemory) => {
+ console.log('totalMemory', totalMemory);
+
+ const persistFilters =
+ totalMemory >= NEUTRINO_PERSISTENT_FILTER_THRESHOLD;
+
+ console.log('persistFilters', persistFilters);
+
+ const config = `[Application Options]
debuglevel=info
maxbackoff=2s
sync-freelist=1
@@ -138,7 +151,7 @@ const writeLndConfig = async (
: ''
}
neutrino.broadcasttimeout=11s
- neutrino.persistfilters=true
+ neutrino.persistfilters=${persistFilters}
[fee]
fee.url=${
@@ -170,8 +183,11 @@ const writeLndConfig = async (
: 'apriori'
}`;
- await writeConfig(config);
- return;
+ console.log('config', config);
+
+ await writeConfig(config);
+ return;
+ });
};
export async function expressGraphSync() {
diff --git a/yarn.lock b/yarn.lock
index efa4642a0..9574b71fd 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -8634,6 +8634,11 @@ react-native-date-picker@4.3.3:
resolved "https://registry.yarnpkg.com/react-native-date-picker/-/react-native-date-picker-4.3.3.tgz#5ca4ca10283538ab9307b7f2dc6b83233ded122b"
integrity sha512-Lq2hGZkwoyCMsxi/uw4KVGu4/xdPZ8AHEx2SU5KY2mipHFpX+r4n5/gXa+rpCRkARJaTFYPZ7S59bT9KMh7fGw==
+react-native-device-info@11.1.0:
+ version "11.1.0"
+ resolved "https://registry.yarnpkg.com/react-native-device-info/-/react-native-device-info-11.1.0.tgz#7db5c4e5a179dce761efac155a493aa0956a40ab"
+ integrity sha512-hzXJSObJdezEz0hF7MAJ3tGeoesuQWenXXt9mrQR9Mjb8kXpZ09rqSsZ/quNpJdZpQ3rYiFa3/0GFG5KNn9PBg==
+
react-native-draglist@3.5.1:
version "3.5.1"
resolved "https://registry.yarnpkg.com/react-native-draglist/-/react-native-draglist-3.5.1.tgz#894df241080fbb94ebeb322c971b8d2db92d8774"