Merge pull request #140 from p2p-org/support-null-values-in-subscription

Support for wider scope of providers
This commit is contained in:
a10zn8
2023-02-14 23:12:37 +04:00
committed by GitHub
2 changed files with 8 additions and 2 deletions

View File

@@ -81,6 +81,9 @@ open class EthereumUpstreamValidator(
}
}
}
.doOnError {
log.warn("Error validating ${upstream.getId()}", it)
}
.onErrorReturn(UpstreamAvailability.UNAVAILABLE)
}

View File

@@ -71,8 +71,11 @@ class EthereumWsHead(
.flatMap { block ->
// newHeads returns incomplete blocks, i.e. without some fields and without transaction hashes,
// so we need to fetch the full block data
if (block.difficulty == null || block.transactions == null) {
// TODO do we really need this ?
if (block.difficulty == null ||
block.transactions == null ||
block.transactions.isEmpty() ||
block.totalDifficulty == null
) {
enhanceRealBlock(block)
} else {
Mono.just(BlockContainer.from(block))