Remove obsolete mtANNOUNCE message support

This commit is contained in:
Vinnie Falco
2013-10-01 14:02:56 -07:00
parent 46d3ace6b7
commit 41879d8511
2 changed files with 0 additions and 58 deletions

View File

@@ -352,7 +352,6 @@ private:
void sendPacketForce (const PackedMessage::pointer & packet);
void sendHello ();
void SendAnnounce ();
void recvHello (protocol::TMHello & packet);
void recvCluster (protocol::TMCluster & packet);
@@ -363,7 +362,6 @@ private:
void recvGetContacts (protocol::TMGetContacts & packet);
void recvGetPeers (protocol::TMGetPeers & packet, Application::ScopedLockType& masterLockHolder);
void recvPeers (protocol::TMPeers & packet);
void recvAnnounce (protocol::TMAnnounce & packet);
void recvGetObjectByHash (const boost::shared_ptr<protocol::TMGetObjectByHash>& packet);
void recvPing (protocol::TMPing & packet);
void recvErrorMessage (protocol::TMErrorMsg & packet);
@@ -853,17 +851,6 @@ void PeerImp::processReadBuffer ()
}
break;
case protocol::mtANNOUNCE:
{
event->reName ("PeerImp::announce");
protocol::TMAnnounce msg;
if(msg.ParseFromArray (&mReadbuf[PackedMessage::kHeaderBytes], mReadbuf.size() - PackedMessage::kHeaderBytes))
recvAnnounce (msg);
else
WriteLog (lsWARNING, Peer) << "parse error: " << type;;
}
case protocol::mtSEARCH_TRANSACTION:
{
event->reName ("PeerImp::searchtransaction");
@@ -1642,15 +1629,6 @@ void PeerImp::recvPeers (protocol::TMPeers& packet)
}
}
void PeerImp::recvAnnounce (protocol::TMAnnounce& packet)
{
// NIKB TODO: First we need to push this announcement to peerfinder
// and then this is not a private peer, we need to "adjust" this
// announcement (i.e. the hop count) and push it out to all our
// other peers. We must be careful to avoid cycles (that is to
// never send an ANNOUNCE back to the peer we got it from).
}
void PeerImp::recvGetObjectByHash (const boost::shared_ptr<protocol::TMGetObjectByHash>& ptr)
{
protocol::TMGetObjectByHash& packet = *ptr;
@@ -2420,32 +2398,6 @@ void PeerImp::sendHello ()
sendPacket (packet, true);
}
void PeerImp::SendAnnounce ()
{
protocol::TMAnnounce a;
std::string selfID = getApp().getLocalCredentials ().getNodePublic ().humanNodePublic ();
a.set_serverid(selfID);
// Since we are announcing ourselves, the hopcount is one and the "via" peer is us.
// If hopcount is anything else, the "via" peer must be different from the "serverid".
a.set_viapeerid(selfID);
a.set_hopcount(1); // A direct connection
// Announce whether we're a private peer or not. Should we even send an ANNOUNCE
// for private peers?
a.set_privatepeer(getConfig ().PEER_PRIVATE);
protocol::TMIPv4EndPoint *ep = a.add_connectpoints();
ep->set_ipv4(inet_addr (getNativeSocket ().local_endpoint ().address ().to_string ().c_str()));
ep->set_ipv4port(getConfig ().peerListeningPort);
PackedMessage::pointer packet = boost::make_shared<PackedMessage> (a, protocol::mtANNOUNCE);
sendPacket (packet, true);
}
void PeerImp::sendGetPeers ()
{
// Ask peer for known other peers.

View File

@@ -14,7 +14,6 @@ enum MessageType
mtCONTACT = 11;
mtGET_PEERS = 12;
mtPEERS = 13;
mtANNOUNCE = 14;
// operations for 'small' nodes
mtSEARCH_TRANSACTION = 20;
@@ -232,15 +231,6 @@ message TMPeers
repeated TMIPv4EndPoint nodes = 1;
}
message TMAnnounce
{
required bytes serverID = 1; // The ID of this server
required bool privatePeer = 2; // This peer is private - the announce will not be propagated
required uint32 hopCount = 3; // The hop count of this server
required bytes viaPeerID = 4; // The ID of the peer through which we know this server
repeated TMIPv4EndPoint connectPoints = 5; // Addresses on which this server accepts connections (can be empty)
};
message TMSearchTransaction
{
required uint32 maxTrans = 1;