Discard non-validator TMSquelch message

This commit is contained in:
Gregory Tsipenyuk
2021-03-10 10:31:27 -05:00
committed by Nik Bougalis
parent ea145d12c7
commit 33b396c7b4

View File

@@ -2868,6 +2868,16 @@ PeerImp::onMessage(std::shared_ptr<protocol::TMSquelch> const& m)
}
PublicKey key(slice);
// Ignore non-validator squelch
if (!app_.validators().listed(key))
{
charge(Resource::feeBadData);
JLOG(p_journal_.debug())
<< "onMessage: TMSquelch discarding non-validator squelch "
<< slice;
return;
}
// Ignore the squelch for validator's own messages.
if (key == app_.getValidationPublicKey())
{