diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-01-09 16:35:20 -0500 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-01-09 16:35:20 -0500 |
| commit | 0b84c10ccc8db26151b25f38869bb462656495d2 (patch) | |
| tree | 2ec398814bce8a65f07778ca0bc4d10361d69fc8 /node/Peer.hpp | |
| parent | afea153a0b0dc8223d4541f16bf8c9e4dfd49e99 (diff) | |
| download | infinitytier-0b84c10ccc8db26151b25f38869bb462656495d2.tar.gz infinitytier-0b84c10ccc8db26151b25f38869bb462656495d2.zip | |
Add confirmation step to new netconf, with the caveat that it will be disabled for older netconf servers to avoid race. Also add some comments.
Diffstat (limited to 'node/Peer.hpp')
| -rw-r--r-- | node/Peer.hpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/node/Peer.hpp b/node/Peer.hpp index 142002a8..09bf0e04 100644 --- a/node/Peer.hpp +++ b/node/Peer.hpp @@ -341,6 +341,32 @@ public: inline unsigned int remoteVersionMinor() const throw() { return _vMinor; } inline unsigned int remoteVersionRevision() const throw() { return _vRevision; } + /** + * Check whether this peer's version is both known and is at least what is specified + * + * @param major Major version to check against + * @param minor Minor version + * @param rev Revision + * @return True if peer's version is at least supplied tuple + */ + inline bool atLeastVersion(unsigned int major,unsigned int minor,unsigned int rev) + throw() + { + if ((_vMajor > 0)||(_vMinor > 0)||(_vRevision > 0)) { + if (_vMajor > major) + return true; + else if (_vMajor == major) { + if (_vMinor > minor) + return true; + else if (_vMinor == minor) { + if (_vRevision >= rev) + return true; + } + } + } + return false; + } + inline bool remoteVersionKnown() const throw() { return ((_vMajor > 0)||(_vMinor > 0)||(_vRevision > 0)); } /** |
