瀏覽代碼

Bit more of adding version to OK(HELLO)

Adam Ierymenko 12 年之前
父節點
當前提交
f6ad138561
共有 2 個文件被更改,包括 6 次插入4 次删除
  1. 4 4
      node/Packet.hpp
  2. 2 0
      node/PacketDecoder.cpp

+ 4 - 4
node/Packet.hpp

@@ -374,10 +374,10 @@ public:
 		 *
 		 *
 		 * OK payload:
 		 * OK payload:
 		 *   <[8] timestamp (echoed from original HELLO)>
 		 *   <[8] timestamp (echoed from original HELLO)>
-		 *   <[1] protocol version>
-		 *   <[1] software major version>
-		 *   <[1] software minor version>
-		 *   <[2] software revision>
+		 *   <[1] protocol version (of responder)>
+		 *   <[1] software major version (of responder)>
+		 *   <[1] software minor version (of responder)>
+		 *   <[2] software revision (of responder)>
 		 *
 		 *
 		 * ERROR has no payload.
 		 * ERROR has no payload.
 		 */
 		 */

+ 2 - 0
node/PacketDecoder.cpp

@@ -273,6 +273,7 @@ bool PacketDecoder::_doHELLO(const RuntimeEnvironment *_r)
 
 
 		SharedPtr<Peer> candidate(new Peer(_r->identity,id));
 		SharedPtr<Peer> candidate(new Peer(_r->identity,id));
 		candidate->setPathAddress(_remoteAddress,false);
 		candidate->setPathAddress(_remoteAddress,false);
+		candidate->setRemoteVersion(vMajor,vMinor,vRevision);
 
 
 		_CBaddPeerFromHello_Data *arg = new _CBaddPeerFromHello_Data;
 		_CBaddPeerFromHello_Data *arg = new _CBaddPeerFromHello_Data;
 		arg->renv = _r;
 		arg->renv = _r;
@@ -290,6 +291,7 @@ bool PacketDecoder::_doHELLO(const RuntimeEnvironment *_r)
 	} catch ( ... ) {
 	} catch ( ... ) {
 		TRACE("dropped HELLO from %s(%s): unexpected exception",source().toString().c_str(),_remoteAddress.toString().c_str());
 		TRACE("dropped HELLO from %s(%s): unexpected exception",source().toString().c_str(),_remoteAddress.toString().c_str());
 	}
 	}
+
 	return true;
 	return true;
 }
 }