fix: Display number of txs in logs

This commit is contained in:
Nathan Woodburn 2025-02-06 12:37:48 +11:00
parent 71f162218f
commit 3b6830e216
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1

View File

@ -83,6 +83,7 @@ def saveTransactions(txList, blockHeight):
# Prepare data for batch insert # Prepare data for batch insert
txValues = [] txValues = []
for txData in txList: for txData in txList:
print('.', end='', flush=True)
txValues.append(( txValues.append((
txData["hash"], txData["witnessHash"], txData["fee"], txData["rate"], txData["hash"], txData["witnessHash"], txData["fee"], txData["rate"],
txData["mtime"], blockHeight, txData["index"], txData["version"], txData["mtime"], blockHeight, txData["index"], txData["version"],
@ -101,7 +102,6 @@ def saveTransactions(txList, blockHeight):
with dbSave.cursor() as cursor: with dbSave.cursor() as cursor:
cursor.executemany(query, txValues) cursor.executemany(query, txValues)
dbSave.commit() dbSave.commit()
print('.', end='', flush=True)
def saveBlock(blockData): def saveBlock(blockData):
hashes = [tx["hash"] for tx in blockData["txs"]] hashes = [tx["hash"] for tx in blockData["txs"]]