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: else:
info "block validation success", validationResult, blockNumber info "block validation success", validationResult, blockNumber
transaction.rollback()
dumpDebuggingMetaData(chainDB, header, body, vmState, false) dumpDebuggingMetaData(chainDB, header, body, vmState, false)
let let
fileName = "debug" & $blockNumber & ".json" fileName = "debug" & $blockNumber & ".json"

View File

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

View File

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