diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/GrpcHead.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/GrpcHead.kt index 2b9ece14..4372e1f1 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/GrpcHead.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/GrpcHead.kt @@ -104,6 +104,8 @@ class GrpcHead( blocks = blocks.onErrorContinue { err, _ -> log.error("Head subscription error. ${err.javaClass.name}:${err.message}", err) + }.doOnNext{ + log.info("Received block ${it.height}") } headSubscription = super.follow(blocks) diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/GrpcUpstreams.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/GrpcUpstreams.kt index 0fafb099..446dd487 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/GrpcUpstreams.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/GrpcUpstreams.kt @@ -44,7 +44,7 @@ import org.apache.commons.lang3.exception.ExceptionUtils import org.slf4j.LoggerFactory import reactor.core.Disposable import reactor.core.publisher.Flux -import java.net.ConnectException +import java.io.IOException import java.time.Duration import java.util.concurrent.atomic.AtomicReference import java.util.concurrent.locks.ReentrantLock @@ -92,7 +92,7 @@ class GrpcUpstreams( .flatMap { client.describe(BlockchainOuterClass.DescribeRequest.newBuilder().build()) }.onErrorContinue { t, _ -> - if (ExceptionUtils.indexOfType(t, ConnectException::class.java) >= 0) { + if (ExceptionUtils.indexOfType(t, IOException::class.java) >= 0) { log.warn("gRPC upstream $host:$port is unavailable. (${t.javaClass}: ${t.message})") known.values.forEach { it.setStatus(UpstreamAvailability.UNAVAILABLE)