remove unused code

This commit is contained in:
Termina1
2022-12-09 23:14:36 +02:00
parent a4f0d44105
commit 8c34a5ce2f
9 changed files with 14 additions and 289 deletions

View File

@@ -32,8 +32,8 @@ import reactor.core.publisher.Mono
open class BitcoinMultistream(
chain: Chain,
private val sourceUpstreams: MutableList<BitcoinUpstream>,
caches: Caches
) : Multistream(chain, sourceUpstreams as MutableList<Upstream>, caches, RequestPostprocessor.Empty()), Lifecycle {
caches: Caches,
) : Multistream(chain, sourceUpstreams as MutableList<Upstream>, caches), Lifecycle {
companion object {
private val log = LoggerFactory.getLogger(BitcoinMultistream::class.java)
@@ -95,6 +95,16 @@ open class BitcoinMultistream(
onHeadUpdated(head)
return head
}
/**
* Finds an API that executed directly on a remote.
*/
open fun getDirectApi(matcher: Selector.Matcher): Mono<Reader<JsonRpcRequest, JsonRpcResponse>> {
val apis = getApiSource(matcher)
apis.request(1)
return Mono.from(apis)
.map(Upstream::getApi)
.switchIfEmpty(Mono.error(Exception("No API available for $chain")))
}
override fun getRoutedApi(matcher: Selector.Matcher): Mono<Reader<JsonRpcRequest, JsonRpcResponse>> {
return Mono.just(callRouter)