diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumUpstreamValidator.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumUpstreamValidator.kt index 3ff8e1a6..ca0c2016 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumUpstreamValidator.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumUpstreamValidator.kt @@ -81,6 +81,9 @@ open class EthereumUpstreamValidator( } } } + .doOnError { + log.warn("Error validating ${upstream.getId()}", it) + } .onErrorReturn(UpstreamAvailability.UNAVAILABLE) } diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumWsHead.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumWsHead.kt index 16e4636a..9bbe36b6 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumWsHead.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumWsHead.kt @@ -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))