diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/ManagedCallMethods.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/ManagedCallMethods.kt index 0e36c6f9..e2ffc47f 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/ManagedCallMethods.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/ManagedCallMethods.kt @@ -47,6 +47,7 @@ class ManagedCallMethods( ) private val quorum: MutableMap = HashMap() private val staticResponse: MutableMap = HashMap() + private val redefined = delegated.filter(enabled::contains).sorted() init { enabled.forEach { m -> @@ -73,7 +74,7 @@ class ManagedCallMethods( override fun getQuorumFor(method: String): CallQuorum { return when { - Collections.binarySearch(delegated, method) >= 0 -> delegate.getQuorumFor(method) + isDelegated(method) && !isRedefined(method) -> delegate.getQuorumFor(method) enabled.contains(method) -> quorum[method] ?: defaultQuorum else -> { log.warn("Getting quorum for unknown method") @@ -82,6 +83,14 @@ class ManagedCallMethods( } } + private fun isDelegated(method: String): Boolean { + return Collections.binarySearch(delegated, method) >= 0 + } + + private fun isRedefined(method: String): Boolean { + return Collections.binarySearch(redefined, method) >= 0 + } + override fun isCallable(method: String): Boolean { return allAllowed.contains(method) }