use transaction.rollback in debug, hunter, and dumper

This commit is contained in:
andri lim 2019-02-22 15:22:20 +07:00 committed by zah
parent 28245e92a2
commit 0e6f96b0e1
3 changed files with 3 additions and 0 deletions

View File

@ -30,6 +30,7 @@ proc executeBlock(blockEnv: JsonNode, memoryDB: TrieDatabaseRef, blockNumber: Ui
else:
info "block validation success", validationResult, blockNumber
transaction.rollback()
dumpDebuggingMetaData(chainDB, header, body, vmState, false)
let
fileName = "debug" & $blockNumber & ".json"

View File

@ -29,6 +29,7 @@ proc dumpDebug(chainDB: BaseChainDB, blockNumber: Uint256) =
captureChainDB.setHead(parent, true)
let validationResult = processBlock(captureChainDB, parent, header, body, vmState)
transaction.rollback()
dumpDebuggingMetaData(captureChainDB, header, body, vmState, false)
proc main() =

View File

@ -75,6 +75,7 @@ proc huntProblematicBlock(blockNumber: Uint256): ValidationResult =
validationResult = processBlock(chainDB, parentBlock.header, thisBlock.header, thisBlock.body, vmState)
if validationResult != ValidationResult.OK:
transaction.rollback()
dumpDebuggingMetaData(chainDB, thisBlock.header, thisBlock.body, vmState, false)
result = validationResult