Punish a peer that sends us unwanted ledger data.

This commit is contained in:
JoelKatz
2012-03-07 09:14:38 -08:00
parent efa2f90b34
commit f08107cd03
2 changed files with 3 additions and 0 deletions

View File

@@ -510,6 +510,8 @@ void Peer::recvGetLedger(newcoin::TMGetLedger& packet)
void Peer::recvLedger(newcoin::TMLedgerData& packet)
{
if(!theApp->getMasterLedgerAcquire().gotLedgerData(packet))
punishPeer(PP_UNWANTED_DATA);
}
void Peer::sendHello()

1
Peer.h
View File

@@ -16,6 +16,7 @@ enum PeerPunish
{
PP_INVALID_REQUEST=1, // The peer sent a request that makes no sense
PP_UNKNOWN_REQUEST=2, // The peer sent a request that might be garbage
PP_UNWANTED_DATA=3, // The peer sent us data we didn't want/need
};
class Peer : public boost::enable_shared_from_this<Peer>