From 7278e58dc80f885b1909989a3b51ab17ccd4b720 Mon Sep 17 00:00:00 2001 From: Taylor Helsper Date: Sat, 26 Jun 2021 23:05:30 -0500 Subject: [PATCH] Resolve issue creating or restoring wallets --- rootfs/standard/usr/bin/mynode_gen_lnd_config.sh | 11 +++++++++++ rootfs/standard/usr/share/mynode/lnd.conf | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/rootfs/standard/usr/bin/mynode_gen_lnd_config.sh b/rootfs/standard/usr/bin/mynode_gen_lnd_config.sh index 800b0c9d..dc50ba72 100755 --- a/rootfs/standard/usr/bin/mynode_gen_lnd_config.sh +++ b/rootfs/standard/usr/bin/mynode_gen_lnd_config.sh @@ -31,6 +31,17 @@ else sed -i "s/bitcoin.testnet=.*/bitcoin.testnet=1/g" /mnt/hdd/mynode/lnd/lnd.conf cat /usr/share/mynode/lnd_testnet.conf >> /mnt/hdd/mynode/lnd/lnd.conf fi + + # Only add wallet-unlock-file line if wallet has been made + if [ -f /mnt/hdd/mynode/settings/.testnet_enabled ]; then + if [ -f /mnt/hdd/mynode/lnd/data/chain/bitcoin/testnet/wallet.db ]; then + sed -i "s/#wallet-unlock-password-file/wallet-unlock-password-file/g" /mnt/hdd/mynode/lnd/lnd.conf + fi + else + if [ -f /mnt/hdd/mynode/lnd/data/chain/bitcoin/mainnet/wallet.db ]; then + sed -i "s/#wallet-unlock-password-file/wallet-unlock-password-file/g" /mnt/hdd/mynode/lnd/lnd.conf + fi + fi fi # Append tor domain diff --git a/rootfs/standard/usr/share/mynode/lnd.conf b/rootfs/standard/usr/share/mynode/lnd.conf index 2b892b67..c5e73099 100644 --- a/rootfs/standard/usr/share/mynode/lnd.conf +++ b/rootfs/standard/usr/share/mynode/lnd.conf @@ -20,7 +20,7 @@ tlsextradomain=mynode.local debuglevel=info #debuglevel=debug -wallet-unlock-password-file=/mnt/hdd/mynode/settings/.lndpw +#wallet-unlock-password-file=/mnt/hdd/mynode/settings/.lndpw ignore-historical-gossip-filters=true accept-keysend=true