From c3190f0c7a18bf543c2bb1ee99aae574131834cb Mon Sep 17 00:00:00 2001 From: andri lim Date: Mon, 21 Jan 2019 20:44:42 +0700 Subject: [PATCH] add db beginTransaction and dispose to hunter --- premix/hunter.nim | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/premix/hunter.nim b/premix/hunter.nim index 1fbbc03bd..eb0fd13cc 100644 --- a/premix/hunter.nim +++ b/premix/hunter.nim @@ -50,6 +50,9 @@ proc prepareBlockEnv(parent: BlockHeader, thisBlock: Block): TrieDatabaseRef = let codeStr = request("eth_getCode", %[%address.prefixHex, parentNumber]) let code = hexToSeqByte(codeStr.getStr).toRange accountDB.setCode(address, code) + + accountDB.setAccount(address, acc) + result = memoryDB proc huntProblematicBlock(blockNumber: Uint256): ValidationResult = @@ -66,10 +69,12 @@ proc huntProblematicBlock(blockNumber: Uint256): ValidationResult = chainDB.setHead(parentBlock.header, true) let + transaction = memoryDB.beginTransaction() vmState = newBaseVMState(parentBlock.header, chainDB) validationResult = processBlock(chainDB, parentBlock.header, thisBlock.header, thisBlock.body, vmState) if validationResult != ValidationResult.OK: + transaction.dispose() dumpDebuggingMetaData(chainDB, thisBlock.header, thisBlock.body, vmState.receipts, false) result = validationResult