Don't reset Bitcoin RPC password if resetting blockchain data

This commit is contained in:
Taylor Helsper 2022-02-09 22:31:42 -06:00
parent 0c9cf7f12f
commit 7b7817bc4d
2 changed files with 9 additions and 3 deletions

View File

@ -536,6 +536,12 @@ chown bitcoin:bitcoin /mnt/hdd/mynode/settings/.btcrpc_environment
if [ -f /mnt/hdd/mynode/bitcoin/bitcoin.conf ]; then
sed -i "s/rpcauth=.*/$RPCAUTH/g" /mnt/hdd/mynode/bitcoin/bitcoin.conf
fi
if [ -f /mnt/hdd/mynode/dojo/docker/my-dojo/conf/docker-bitcoind.conf ]; then
sed -i "s/BITCOIND_RPC_PASSWORD=.*/BITCOIND_RPC_PASSWORD=$BTCRPCPW/g" /mnt/hdd/mynode/dojo/docker/my-dojo/conf/docker-bitcoind.conf
fi
if [ -f /mnt/hdd/mynode/dojo/docker/my-dojo/conf/docker-bitcoind.conf.tpl ]; then
sed -i "s/BITCOIND_RPC_PASSWORD=.*/BITCOIND_RPC_PASSWORD=$BTCRPCPW/g" /mnt/hdd/mynode/dojo/docker/my-dojo/conf/docker-bitcoind.conf.tpl
fi
# Append bitcoin UID and GID to btcrpc_environment

View File

@ -891,8 +891,8 @@ def reset_bitcoin_env_file():
def delete_bitcoin_data():
os.system("rm -rf /mnt/hdd/mynode/bitcoin")
os.system("rm -rf /mnt/hdd/mynode/quicksync/.quicksync_complete")
os.system("rm -rf /mnt/hdd/mynode/settings/.btcrpc_environment")
os.system("rm -rf /mnt/hdd/mynode/settings/.btcrpcpw")
#os.system("rm -rf /mnt/hdd/mynode/settings/.btcrpc_environment")
#os.system("rm -rf /mnt/hdd/mynode/settings/.btcrpcpw")
def reset_blockchain():
stop_bitcoin()
@ -1206,5 +1206,5 @@ def generate_qr_code(url):
img = qr.make_image()
return img
except Exception as e:
print("generate_qr_code exception: {}".format(str(e)))
log_message("generate_qr_code exception: {}".format(str(e)))
return None