mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-22 20:15:51 +00:00
adds method to SquelchHandler to squelch all peers
This commit is contained in:
@@ -75,7 +75,7 @@ public:
|
|||||||
virtual ~SquelchHandler()
|
virtual ~SquelchHandler()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
/** Squelch handler
|
/** Squelch handler for a single peer
|
||||||
* @param validator Public key of the source validator
|
* @param validator Public key of the source validator
|
||||||
* @param id Peer's id to squelch
|
* @param id Peer's id to squelch
|
||||||
* @param duration Squelch duration in seconds
|
* @param duration Squelch duration in seconds
|
||||||
@@ -83,6 +83,15 @@ public:
|
|||||||
virtual void
|
virtual void
|
||||||
squelch(PublicKey const& validator, Peer::id_t id, std::uint32_t duration)
|
squelch(PublicKey const& validator, Peer::id_t id, std::uint32_t duration)
|
||||||
const = 0;
|
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
|
/** Unsquelch handler
|
||||||
* @param validator Public key of the source validator
|
* @param validator Public key of the source validator
|
||||||
* @param id Peer's id to unsquelch
|
* @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
|
void
|
||||||
OverlayImpl::updateSlotAndSquelch(
|
OverlayImpl::updateSlotAndSquelch(
|
||||||
uint256 const& key,
|
uint256 const& key,
|
||||||
|
|||||||
@@ -451,6 +451,10 @@ private:
|
|||||||
Peer::id_t const id,
|
Peer::id_t const id,
|
||||||
std::uint32_t squelchDuration) const override;
|
std::uint32_t squelchDuration) const override;
|
||||||
|
|
||||||
|
void
|
||||||
|
squelchAll(PublicKey const& validator, std::uint32_t squelchDuration)
|
||||||
|
override;
|
||||||
|
|
||||||
void
|
void
|
||||||
unsquelch(PublicKey const& validator, Peer::id_t id) const override;
|
unsquelch(PublicKey const& validator, Peer::id_t id) const override;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user