diff options
Diffstat (limited to 'rpc/utils.go')
-rw-r--r-- | rpc/utils.go | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/rpc/utils.go b/rpc/utils.go index 2506c4833..9315cab59 100644 --- a/rpc/utils.go +++ b/rpc/utils.go @@ -119,21 +119,6 @@ func isHexNum(t reflect.Type) bool { return t == bigIntType } -var blockNumberType = reflect.TypeOf((*BlockNumber)(nil)).Elem() - -// Indication if the given block is a BlockNumber -func isBlockNumber(t reflect.Type) bool { - if t == nil { - return false - } - - for t.Kind() == reflect.Ptr { - t = t.Elem() - } - - return t == blockNumberType -} - // suitableCallbacks iterates over the methods of the given type. It will determine if a method satisfies the criteria // for a RPC callback or a subscription callback and adds it to the collection of callbacks or subscriptions. See server // documentation for a summary of these criteria. @@ -210,18 +195,12 @@ METHODS: } switch mtype.NumOut() { - case 0, 1: - break - case 2: - if h.errPos == -1 { // method must one return value and 1 error + case 0, 1, 2: + if mtype.NumOut() == 2 && h.errPos == -1 { // method must one return value and 1 error continue METHODS } - break - default: - continue METHODS + callbacks[mname] = &h } - - callbacks[mname] = &h } return callbacks, subscriptions |