IsCompatibleWith returns the lowest version that is compatible with both versions. If the versions are not compatible, the second return value will be false.
(other RPCVersion)
| 67 | // versions. If the versions are not compatible, the second return value will be |
| 68 | // false. |
| 69 | func (v RPCVersion) IsCompatibleWith(other RPCVersion) (RPCVersion, bool) { |
| 70 | if v.Major != other.Major { |
| 71 | return RPCVersion{}, false |
| 72 | } |
| 73 | // The lowest minor version from the two versions should be returned. |
| 74 | if v.Minor < other.Minor { |
| 75 | return v, true |
| 76 | } |
| 77 | return other, true |
| 78 | } |
| 79 | |
| 80 | // RPCVersionList represents a list of RPC versions supported by a RPC peer. An |
| 81 | type RPCVersionList struct { |
no outgoing calls