This repository was archived by the owner on Oct 24, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
android/src/main/java/com/reactnativelightning Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -109,8 +109,14 @@ private void setAvailableMethods() {
109
109
110
110
@ ReactMethod
111
111
public void start (String configContent , String network , final Promise promise ) {
112
- File appDir = getReactApplicationContext ().getFilesDir ();
113
- writeToConfig (configContent , appDir );
112
+ String appDir = getReactApplicationContext ().getFilesDir ().toString ().concat ("/lnd" );
113
+
114
+ File appFile = new File (appDir );
115
+ if (!appFile .exists ()){
116
+ appFile .mkdirs ();
117
+ }
118
+
119
+ writeToConfig (configContent , new File (appDir ));
114
120
115
121
final String logDir = appDir + "/logs/bitcoin/" + network ;
116
122
final String logFile = logDir + "/lnd.log" ;
@@ -331,7 +337,7 @@ public void run() {
331
337
332
338
@ ReactMethod
333
339
public void walletExists (String network , final Promise promise ) {
334
- File directory = new File (getReactApplicationContext ().getFilesDir ().toString () + "/data/chain/bitcoin/" + network + "/wallet.db" );
340
+ File directory = new File (getReactApplicationContext ().getFilesDir ().toString () + "/lnd/ data/chain/bitcoin/" + network + "/wallet.db" );
335
341
boolean exists = directory .exists ();
336
342
Log .d (TAG , "Wallet exists: " + exists );
337
343
promise .resolve (exists );
You can’t perform that action at this time.
0 commit comments