lnd: improve waiting for active RPC server
- Simplify - Add comment - Avoid the unneeded default call to sleep
This commit is contained in:
parent
adeccce06e
commit
637a58d826
@ -238,13 +238,8 @@ in {
|
|||||||
-d "{\"wallet_password\": \"$(cat ${secretsDir}/lnd-wallet-password | tr -d '\n' | base64 -w0)\"}" \
|
-d "{\"wallet_password\": \"$(cat ${secretsDir}/lnd-wallet-password | tr -d '\n' | base64 -w0)\"}" \
|
||||||
${restUrl}/unlockwallet
|
${restUrl}/unlockwallet
|
||||||
fi
|
fi
|
||||||
state=""
|
# Wait until the wallet has been unlocked and RPC is fully active
|
||||||
while [ "$state" != "RPC_ACTIVE" ]; do
|
while [[ $(${curl} -d '{}' -X POST ${restUrl}/state | ${pkgs.jq}/bin/jq -r '.state') != RPC_ACTIVE ]]; do
|
||||||
state=$(${curl} \
|
|
||||||
-d '{}' \
|
|
||||||
-X POST \
|
|
||||||
${restUrl}/state |\
|
|
||||||
${pkgs.jq}/bin/jq -r '.state')
|
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
done
|
done
|
||||||
'')
|
'')
|
||||||
|
Loading…
Reference in New Issue
Block a user