mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Function to check if a peer has a ledger.
This commit is contained in:
@@ -1113,6 +1113,11 @@ void Peer::recvLedger(newcoin::TMLedgerData& packet)
|
||||
punishPeer(PP_UNWANTED_DATA);
|
||||
}
|
||||
|
||||
bool Peer::hasLedger(const uint256& hash) const
|
||||
{
|
||||
return (hash == mClosedLedgerHash) || (hash == mPreviousLedgerHash);
|
||||
}
|
||||
|
||||
// Get session information we can sign to prevent man in the middle attack.
|
||||
// (both sides get the same information, neither side controls it)
|
||||
void Peer::getSessionCookie(std::string& strDst)
|
||||
|
||||
@@ -159,6 +159,7 @@ public:
|
||||
static PackedMessage::pointer createGetFullLedger(uint256& hash);
|
||||
|
||||
uint256 getClosedLedgerHash() const { return mClosedLedgerHash; }
|
||||
bool hasLedger(const uint256& hash) const;
|
||||
NewcoinAddress getNodePublic() const { return mNodePublic; }
|
||||
void cycleStatus() { mPreviousLedgerHash = mClosedLedgerHash; mClosedLedgerHash.zero(); }
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user