From 449e35fd03022f4c3bc6f6874b7a18ca5679fba9 Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Wed, 5 Feb 2025 23:16:28 +1100 Subject: [PATCH] fix: Specify char set --- main.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index 3519256..cb72551 100644 --- a/main.py +++ b/main.py @@ -97,8 +97,8 @@ def saveBlock(blockData): def setupDB(): """Creates the database tables""" with db.cursor() as cursor: - cursor.execute("CREATE TABLE IF NOT EXISTS blocks (hash VARCHAR(64), height BIGINT, depth INT, version INT, prevBlock VARCHAR(64), merkleRoot VARCHAR(64), witnessRoot VARCHAR(64), treeRoot VARCHAR(64), reservedRoot VARCHAR(64), time INT, bits INT, nonce BIGINT UNSIGNED, extraNonce VARCHAR(64), mask VARCHAR(64), txs JSON)") - cursor.execute("CREATE TABLE IF NOT EXISTS transactions (hash VARCHAR(64), witnessHash VARCHAR(64), fee BIGINT, rate BIGINT, mtime BIGINT, block BIGINT, `index` INT, version INT, inputs JSON, outputs JSON, locktime BIGINT, hex LONGTEXT)") + cursor.execute("CREATE TABLE IF NOT EXISTS blocks (hash VARCHAR(64), height BIGINT, depth INT, version INT, prevBlock VARCHAR(64), merkleRoot VARCHAR(64), witnessRoot VARCHAR(64), treeRoot VARCHAR(64), reservedRoot VARCHAR(64), time INT, bits INT, nonce BIGINT UNSIGNED, extraNonce VARCHAR(64), mask VARCHAR(64), txs JSON) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci") + cursor.execute("CREATE TABLE IF NOT EXISTS transactions (hash VARCHAR(64), witnessHash VARCHAR(64), fee BIGINT, rate BIGINT, mtime BIGINT, block BIGINT, `index` INT, version INT, inputs JSON, outputs JSON, locktime BIGINT, hex LONGTEXT) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci") # Get the newest block height in the database def getNewestBlock() -> int: @@ -184,9 +184,6 @@ def getFirstMissingBlock(): return block - - - async def main(): blockWatcher = BlockWatcher(HSD_URL) blockWatcher.start()