diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/near/NearLowerBoundStateDetector.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/near/NearLowerBoundStateDetector.kt index 870c8b47..dda81974 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/near/NearLowerBoundStateDetector.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/near/NearLowerBoundStateDetector.kt @@ -8,7 +8,6 @@ import io.emeraldpay.dshackle.upstream.lowerbound.LowerBoundDetector import io.emeraldpay.dshackle.upstream.lowerbound.LowerBoundType import io.emeraldpay.dshackle.upstream.rpcclient.ListParams import reactor.core.publisher.Flux -import reactor.kotlin.core.publisher.toFlux class NearLowerBoundStateDetector( private val upstream: Upstream, @@ -21,8 +20,15 @@ class NearLowerBoundStateDetector( override fun internalDetectLowerBound(): Flux { return upstream.getIngressReader().read(ChainRequest("status", ListParams())).map { val resp = Global.objectMapper.readValue(it.getResult(), NearStatus::class.java) - LowerBoundData(resp.syncInfo.earliestHeight, LowerBoundType.STATE) - }.toFlux() + resp.syncInfo.earliestHeight + }.flatMapMany { + Flux.fromIterable( + listOf( + LowerBoundData(it, LowerBoundType.STATE), + LowerBoundData(it, LowerBoundType.BLOCK), + ), + ) + } } override fun types(): Set {