Merge pull request #84 from p2p-org/fix_cincurrent_modification

fix concurrent modification
This commit is contained in:
MaxFomenkov
2022-12-13 19:08:36 +03:00
committed by GitHub

View File

@@ -21,8 +21,14 @@ import io.emeraldpay.dshackle.Chain
import io.emeraldpay.dshackle.cache.Caches
import io.emeraldpay.dshackle.config.UpstreamsConfig
import io.emeraldpay.dshackle.reader.Reader
import io.emeraldpay.dshackle.upstream.*
import io.emeraldpay.dshackle.upstream.ChainFees
import io.emeraldpay.dshackle.upstream.EmptyHead
import io.emeraldpay.dshackle.upstream.Head
import io.emeraldpay.dshackle.upstream.Lifecycle
import io.emeraldpay.dshackle.upstream.MergedHead
import io.emeraldpay.dshackle.upstream.Multistream
import io.emeraldpay.dshackle.upstream.Selector
import io.emeraldpay.dshackle.upstream.Upstream
import io.emeraldpay.dshackle.upstream.forkchoice.PriorityForkChoice
import io.emeraldpay.dshackle.upstream.grpc.GrpcUpstream
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcRequest
@@ -126,7 +132,7 @@ open class EthereumPosMultiStream(
val newHead = MergedHead(heads, PriorityForkChoice(), "ETH Pos Multistream").apply {
this.start()
}
val lagObserver = EthereumPosHeadLagObserver(newHead, upstreams as Collection<Upstream>)
val lagObserver = EthereumPosHeadLagObserver(newHead, ArrayList(upstreams))
this.lagObserver = lagObserver
lagObserver.start()
newHead