mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-18 18:15:50 +00:00
adds method to SquelchHandler to squelch all peers
This commit is contained in:
@@ -75,7 +75,7 @@ public:
|
||||
virtual ~SquelchHandler()
|
||||
{
|
||||
}
|
||||
/** Squelch handler
|
||||
/** Squelch handler for a single peer
|
||||
* @param validator Public key of the source validator
|
||||
* @param id Peer's id to squelch
|
||||
* @param duration Squelch duration in seconds
|
||||
@@ -83,6 +83,15 @@ public:
|
||||
virtual void
|
||||
squelch(PublicKey const& validator, Peer::id_t id, std::uint32_t duration)
|
||||
const = 0;
|
||||
|
||||
/** Squelch for all peers, the method must call slots.squelchValidator
|
||||
* to register that a (validator,peer) was squelched
|
||||
* @param validator Public key of the source validator
|
||||
* @param duration Squelch duration in seconds
|
||||
*/
|
||||
virtual void
|
||||
squelchAll(PublicKey const& validator, std::uint32_t duration) = 0;
|
||||
|
||||
/** Unsquelch handler
|
||||
* @param validator Public key of the source validator
|
||||
* @param id Peer's id to unsquelch
|
||||
|
||||
@@ -1410,6 +1410,15 @@ OverlayImpl::squelch(
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
OverlayImpl::squelchAll(PublicKey const& validator, uint32_t squelchDuration)
|
||||
{
|
||||
for_each([&](std::shared_ptr<PeerImp>&& p) {
|
||||
slots_.squelchValidator(validator, p->id());
|
||||
p->send(makeSquelchMessage(validator, true, squelchDuration));
|
||||
});
|
||||
}
|
||||
|
||||
void
|
||||
OverlayImpl::updateSlotAndSquelch(
|
||||
uint256 const& key,
|
||||
|
||||
@@ -451,6 +451,10 @@ private:
|
||||
Peer::id_t const id,
|
||||
std::uint32_t squelchDuration) const override;
|
||||
|
||||
void
|
||||
squelchAll(PublicKey const& validator, std::uint32_t squelchDuration)
|
||||
override;
|
||||
|
||||
void
|
||||
unsquelch(PublicKey const& validator, Peer::id_t id) const override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user