Skip to content

Commit

Permalink
Add -datadir requirement for logger (and overridable in run script)
Browse files Browse the repository at this point in the history
  • Loading branch information
Simewu committed Dec 29, 2023
1 parent 2232f60 commit 7a27d88
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 1,940 deletions.
12 changes: 7 additions & 5 deletions LogIndividualPeerInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,8 @@ def startCJDNS():
# Start the Bitcoin Core instance
def startBitcoin():
global isInStartupDownload
if not isBitcoinUp():
# If Bitcoin crashed for whatever reason before, remove the PID that would prevent it from starting again
terminal(f'rm -rf {os.path.join(bitcoinDirectory, "bitcoind.pid")}')

networkParams = ''
networkParams = f' -datadir="{bitcoinDirectory}"'
if EnabledIPv4:
networkParams += ' -onlynet=ipv4'
if EnabledIPv6:
Expand All @@ -300,10 +297,15 @@ def startBitcoin():
if EnabledCJDNS:
networkParams += ' -cjdnsreachable=1 -onlynet=cjdns'

print('Starting Bitcoin...')
print('Starting Bitcoin in', bitcoinDirectory, '...')
rpcReady = False
while rpcReady is False:
if not isBitcoinUp():
# If Bitcoin crashed for whatever reason before, remove the PID that would prevent it from starting again
if os.path.exists(os.path.join(bitcoinDirectory, 'bitcoind.pid')):
print('Removing old Bitcoin PID file...')
os.remove(os.path.join(bitcoinDirectory, 'bitcoind.pid'))

if filesToLog['bitcoin_debug.log']:
subprocess.Popen([f'gnome-terminal -t "Bitcoin Core Instance" -- bash ./run.sh noconsole{networkParams} --daemon --debug=all'], shell=True)
else:
Expand Down
Loading

0 comments on commit 7a27d88

Please sign in to comment.