From 72c4f1192bdb90309404f2cb60f6282ca9dfd48c Mon Sep 17 00:00:00 2001 From: KirillPamPam Date: Thu, 18 May 2023 14:51:26 +0400 Subject: [PATCH] Fix update methods after restart provider dshackle (#213) --- .../io/emeraldpay/dshackle/upstream/grpc/BitcoinGrpcUpstream.kt | 2 +- .../emeraldpay/dshackle/upstream/grpc/EthereumGrpcUpstream.kt | 2 +- .../dshackle/upstream/grpc/EthereumPosGrpcUpstream.kt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/BitcoinGrpcUpstream.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/BitcoinGrpcUpstream.kt index 23e1bccf..54ab83b6 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/BitcoinGrpcUpstream.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/BitcoinGrpcUpstream.kt @@ -163,10 +163,10 @@ class BitcoinGrpcUpstream( val newBuildInfo = BuildInfo.extract(buildInfo) val buildInfoChanged = this.buildInfo.update(newBuildInfo) val newCapabilities = RemoteCapabilities.extract(conf) - conf.status?.let { status -> onStatus(status) } val upstreamStatusChanged = (upstreamStatus.update(conf) || (newCapabilities != capabilities)).also { capabilities = newCapabilities } + conf.status?.let { status -> onStatus(status) } return buildInfoChanged || upstreamStatusChanged } } diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/EthereumGrpcUpstream.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/EthereumGrpcUpstream.kt index f52783d2..2dddb790 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/EthereumGrpcUpstream.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/EthereumGrpcUpstream.kt @@ -148,10 +148,10 @@ open class EthereumGrpcUpstream( val newBuildInfo = BuildInfo.extract(buildInfo) val buildInfoChanged = this.buildInfo.update(newBuildInfo) val newCapabilities = RemoteCapabilities.extract(conf) - conf.status?.let { status -> onStatus(status) } val upstreamStatusChanged = (upstreamStatus.update(conf) || (newCapabilities != capabilities)).also { capabilities = newCapabilities } + conf.status?.let { status -> onStatus(status) } return buildInfoChanged || upstreamStatusChanged } diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/EthereumPosGrpcUpstream.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/EthereumPosGrpcUpstream.kt index 72c9e771..80847e39 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/EthereumPosGrpcUpstream.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/EthereumPosGrpcUpstream.kt @@ -115,10 +115,10 @@ open class EthereumPosGrpcUpstream( val newBuildInfo = BuildInfo.extract(buildInfo) val buildInfoChanged = this.buildInfo.update(newBuildInfo) val newCapabilities = RemoteCapabilities.extract(conf) - conf.status?.let { status -> onStatus(status) } val upstreamStatusChanged = (upstreamStatus.update(conf) || (newCapabilities != capabilities)).also { capabilities = newCapabilities } + conf.status?.let { status -> onStatus(status) } return buildInfoChanged || upstreamStatusChanged }