Merge pull request #10 from p2p-org/fix_divide_by_zero_error
log failed validation
This commit is contained in:
@@ -57,7 +57,12 @@ abstract class AbstractHead(
|
|||||||
}
|
}
|
||||||
.subscribeOn(Schedulers.boundedElastic())
|
.subscribeOn(Schedulers.boundedElastic())
|
||||||
.subscribe { block ->
|
.subscribe { block ->
|
||||||
if (blockValidator.isValid(forkChoice.getHead(), block)) {
|
val valid = runCatching {
|
||||||
|
blockValidator.isValid(forkChoice.getHead(), block)
|
||||||
|
}.onFailure {
|
||||||
|
log.error("Block ${block.hash} validation failed with '${it.message}'", it)
|
||||||
|
}.getOrElse { false }
|
||||||
|
if (valid) {
|
||||||
notifyBeforeBlock()
|
notifyBeforeBlock()
|
||||||
when (val choiceResult = forkChoice.choose(block)) {
|
when (val choiceResult = forkChoice.choose(block)) {
|
||||||
is ForkChoice.ChoiceResult.Updated -> {
|
is ForkChoice.ChoiceResult.Updated -> {
|
||||||
|
|||||||
Reference in New Issue
Block a user