Fix duplicate validation and manifest suppression

RIPD-1636
RIPD-1638
RIPD-1632
This commit is contained in:
wilsonianb
2018-05-31 17:19:42 -05:00
committed by Mike Ellery
parent f0cc7c4c8d
commit 31e511afcf
6 changed files with 44 additions and 20 deletions

View File

@@ -724,11 +724,12 @@ PeerImp::doProtocolStart()
app_.validatorManifests ().for_each_manifest (
[&tm](std::size_t s){tm.mutable_list()->Reserve(s);},
[&tm](Manifest const& manifest)
[&tm, &hr = app_.getHashRouter()](Manifest const& manifest)
{
auto const& s = manifest.serialized;
auto& tm_e = *tm.add_list();
tm_e.set_stobject(s.data(), s.size());
hr.addSuppression(manifest.hash());
});
if (tm.list_size() > 0)
@@ -1311,13 +1312,6 @@ PeerImp::onMessage (std::shared_ptr <protocol::TMProposeSet> const& m)
return;
}
if (!app_.getValidationPublicKey().empty() &&
publicKey == app_.getValidationPublicKey())
{
JLOG(p_journal_.trace()) << "Proposal: self";
return;
}
auto const isTrusted = app_.validators().trusted (publicKey);
if (!isTrusted)
@@ -2046,7 +2040,9 @@ PeerImp::checkValidation (STValidation::pointer val,
if (app_.getOPs ().recvValidation(val, std::to_string(id())) ||
cluster())
{
overlay_.relay(*packet, signingHash);
auto const suppression = sha512Half(
makeSlice(val->getSerialized()));
overlay_.relay(*packet, suppression);
}
}
catch (std::exception const&)