2
0
mirror of https://github.com/lnbook/lnbook synced 2024-11-18 21:28:03 +00:00

bitcoind: Use loadwallet when restarting

When restarting a docker-compose set of containers we might already
have created the wallet, so load it instead.
This commit is contained in:
Christian Decker 2021-08-25 21:16:20 +02:00
parent c2c2d89569
commit 28fe6cbcde

View File

@ -15,8 +15,10 @@ echo "Importing demo private key"
echo "Bitcoin address: " ${address} echo "Bitcoin address: " ${address}
echo "Private key: " ${privkey} echo "Private key: " ${privkey}
echo "================================================" echo "================================================"
bitcoin-cli -datadir=/bitcoind createwallet regtest # If restarting the wallet already exists, so don't fail if it does,
bitcoin-cli -datadir=/bitcoind importprivkey $privkey # just load the existing wallet:
bitcoin-cli -datadir=/bitcoind createwallet regtest || bitcoin-cli -datadir=/bitcoind loadwallet regtest
bitcoin-cli -datadir=/bitcoind importprivkey $privkey || true
# Executing CMD # Executing CMD
echo "$@" echo "$@"