diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/CachingEthereumApi.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/CachingEthereumApi.kt index edf4316e..10343f77 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/CachingEthereumApi.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/CachingEthereumApi.kt @@ -44,14 +44,19 @@ open class CachingEthereumApi( override fun execute(id: Int, method: String, params: List): Mono { return when (method) { - "eth_blockNumber" -> head.getFlux().next() + "eth_blockNumber" -> + head.getFlux().next() .map { HexQuantity.from(it.number).toHex() } .map(toJson(id)) - "eth_getBlockByHash" -> Mono.just(params[0]) - .map { BlockHash.from(it as String) } - .flatMap(cache::read) - .map(toJson(id)) - else -> Mono.empty() + "eth_getBlockByHash" -> + if (params.size == 2 && (params[1] == "false" || params[1] == false)) + Mono.just(params[0]) + .map { BlockHash.from(it as String) } + .flatMap(cache::read) + .map(toJson(id)) + else Mono.empty() + else -> + Mono.empty() } }