premix: fix dumper tool, dispose db changes

This commit is contained in:
andri lim 2019-02-07 10:55:49 +07:00 committed by zah
parent 987c561b0c
commit fdc9a15785
1 changed files with 4 additions and 0 deletions

View File

@ -17,6 +17,7 @@ proc dumpDebug(chainDB: BaseChainDB, blockNumber: Uint256) =
captureChainDB = newBaseChainDB(captureTrieDB, false)
let
transaction = memoryDB.beginTransaction()
parentNumber = blockNumber - 1
parent = captureChainDB.getBlockHeader(parentNumber)
header = captureChainDB.getBlockHeader(blockNumber)
@ -26,6 +27,9 @@ proc dumpDebug(chainDB: BaseChainDB, blockNumber: Uint256) =
captureChainDB.setHead(parent, true)
let validationResult = processBlock(captureChainDB, parent, header, body, vmState)
# success or not dispose it
transaction.dispose()
dumpDebuggingMetaData(captureChainDB, header, body, vmState, false)
proc main() =