lnd: check that state is RPC_ACTIVE after unlocking

The state service is newly introduced in lnd 0.13.0.
This commit is contained in:
Jonas Nick 2021-07-07 12:21:54 +00:00
parent c75347027b
commit a23b9d1c2d
No known key found for this signature in database
GPG Key ID: 4861DBF262123605

View File

@ -239,6 +239,16 @@ in {
-d "{\"wallet_password\": \"$(cat ${secretsDir}/lnd-wallet-password | tr -d '\n' | base64 -w0)\"}" \
${restUrl}/unlockwallet
fi
state=""
while [ "$state" != "RPC_ACTIVE" ]; do
state=$(${curl} \
--cacert ${secretsDir}/lnd-cert \
-d '{}' \
-X POST \
${restUrl}/state |\
${pkgs.jq}/bin/jq -r '.state')
sleep 0.1
done
'')
# Setting macaroon permission for other users needs root permissions
(nbLib.privileged "lnd-create-macaroons" ''