Skip to content

Commit

Permalink
Fix bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
Ouziel committed Dec 15, 2024
1 parent 5a16878 commit 0891688
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions counterparty-core/counterpartycore/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -988,13 +988,18 @@ def bootstrap(no_confirm=False, snapshot_url=None):
if config.TESTNET:
ledger_database_path += ".testnet"
ledger_database_path += ".db"
api_database_path = ledger_database_path.replace(".db", ".api.db")

old_api_database_path = ledger_database_path.replace(".db", ".api.db")
if config.TESTNET:
api_database_path = os.path.join(config.DATA_DIR, "state.testnet.db")
else:
api_database_path = os.path.join(config.DATA_DIR, "state.db")

# Prepare Directory.
if not os.path.exists(config.DATA_DIR):
os.makedirs(config.DATA_DIR, mode=0o755)

for database_path in [ledger_database_path, api_database_path]:
for database_path in [ledger_database_path, api_database_path, old_api_database_path]:
if os.path.exists(database_path):
os.remove(database_path)
# Delete SQLite Write-Ahead-Log
Expand Down

0 comments on commit 0891688

Please sign in to comment.