mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Punish a peer that sends us unwanted ledger data.
This commit is contained in:
2
Peer.cpp
2
Peer.cpp
@@ -510,6 +510,8 @@ void Peer::recvGetLedger(newcoin::TMGetLedger& packet)
|
|||||||
|
|
||||||
void Peer::recvLedger(newcoin::TMLedgerData& packet)
|
void Peer::recvLedger(newcoin::TMLedgerData& packet)
|
||||||
{
|
{
|
||||||
|
if(!theApp->getMasterLedgerAcquire().gotLedgerData(packet))
|
||||||
|
punishPeer(PP_UNWANTED_DATA);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Peer::sendHello()
|
void Peer::sendHello()
|
||||||
|
|||||||
1
Peer.h
1
Peer.h
@@ -16,6 +16,7 @@ enum PeerPunish
|
|||||||
{
|
{
|
||||||
PP_INVALID_REQUEST=1, // The peer sent a request that makes no sense
|
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_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>
|
class Peer : public boost::enable_shared_from_this<Peer>
|
||||||
|
|||||||
Reference in New Issue
Block a user