Skip to content

Commit

Permalink
Fix Password for lnd instance.
Browse files Browse the repository at this point in the history
  • Loading branch information
ziggie1984 committed Oct 2, 2024
1 parent d946972 commit 1e6e26b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions docker-initunlocklnd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ if [ -f "$WALLET_FILE" ]; then
WALLETPASS=$(jq -c -r '.wallet_password' $LNDUNLOCK_FILE)
# Nicolas deleted default password in some wallet unlock files, so we initializing default if password is empty
[ "$WALLETPASS" == "" ] && WALLETPASS="hellorockstar"
WALLETPASS_BASE64=$(echo $WALLETPASS|base64|tr -d '\n\r')
WALLETPASS_BASE64=$(echo $WALLETPASS|tr -d '\n\r'|base64)

# execute unlockwallet call
curl -s --cacert "$CA_CERT" -X POST -H "$MACAROON_HEADER" -d '{ "wallet_password":"'$WALLETPASS_BASE64'" }' $LND_REST_LISTEN_HOST/v1/unlockwallet
Expand All @@ -77,8 +77,9 @@ else
mkdir -p $LND_WALLET_DIR
echo $RESULTJSON > $LNDUNLOCK_FILE

# prepare initwallet call json with wallet password and chipher seed mnemonic
WALLETPASS_BASE64=$(echo $WALLETPASS|base64|tr -d '\n\r')
# previous versions will have a default wallet password including a line feed at the end "hellorockstar\n"
# line feed hex code 0x0A.
WALLETPASS_BASE64=$(echo $WALLETPASS|tr -d '\n\r'|base64)
INITWALLET_REQ='{"wallet_password":"'$WALLETPASS_BASE64'", "cipher_seed_mnemonic":'$CIPHER_ARRAY_EXTRACTED'}'

# execute initwallet call
Expand Down

0 comments on commit 1e6e26b

Please sign in to comment.