diff --git a/code/docker/bitcoind/bitcoind-entrypoint.sh b/code/docker/bitcoind/bitcoind-entrypoint.sh index c9a17f8..51b65d7 100644 --- a/code/docker/bitcoind/bitcoind-entrypoint.sh +++ b/code/docker/bitcoind/bitcoind-entrypoint.sh @@ -15,8 +15,10 @@ echo "Importing demo private key" echo "Bitcoin address: " ${address} echo "Private key: " ${privkey} echo "================================================" -bitcoin-cli -datadir=/bitcoind createwallet regtest -bitcoin-cli -datadir=/bitcoind importprivkey $privkey +# If restarting the wallet already exists, so don't fail if it does, +# 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 echo "$@"