Merge pull request #354 from status-im/fixAsserts

Add txRoot check to avoid assertions in tracer + don't throw exception
This commit is contained in:
kdeme 2019-07-16 11:06:43 +02:00 committed by GitHub
commit 10fdabe014
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -52,9 +52,10 @@ method persistBlocks*(c: Chain, headers: openarray[BlockHeader], bodies: openarr
let validationResult = processBlock(c.db, headers[i], bodies[i], vmState)
when not defined(release):
if validationResult == ValidationResult.Error:
if validationResult == ValidationResult.Error and
bodies[i].transactions.calcTxRoot == headers[i].txRoot:
dumpDebuggingMetaData(c.db, headers[i], bodies[i], vmState)
raise newException(Exception, "Validation error. Debugging metadata dumped.")
warn "Validation error. Debugging metadata dumped."
if validationResult != ValidationResult.OK:
return validationResult