From 601350d8d02d8f1285fd47b5a75b47e103322e79 Mon Sep 17 00:00:00 2001 From: andri lim Date: Wed, 6 Feb 2019 17:21:02 +0700 Subject: [PATCH] premix: fixes debug tool, dispose db changes --- premix/debug.nim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/premix/debug.nim b/premix/debug.nim index c4a7d9333..2e8f0cc63 100644 --- a/premix/debug.nim +++ b/premix/debug.nim @@ -20,14 +20,18 @@ proc executeBlock(blockEnv: JsonNode, memoryDB: TrieDatabaseRef, blockNumber: Ui body = chainDB.getBlockBody(header.blockHash) let + transaction = memoryDB.beginTransaction() vmState = newBaseVMState(parent, chainDB) validationResult = processBlock(chainDB, parent, header, body, vmState) - if validationResult != ValidationResult.OK: + if validationResult != ValidationResult.OK: error "block validation error", validationResult else: info "block validation success", validationResult, blockNumber + # success or not dispose it + transaction.dispose() + dumpDebuggingMetaData(chainDB, header, body, vmState, false) let fileName = "debug" & $blockNumber & ".json"