Remove STValidation::isValid overload

This commit is contained in:
Crypto Brad Garlinghouse
2018-06-14 03:49:30 +00:00
committed by Nik Bougalis
parent e03efdbe0b
commit 8d59ed5b2a
4 changed files with 6 additions and 19 deletions

View File

@@ -1917,13 +1917,10 @@ PeerImp::onMessage (std::shared_ptr <protocol::TMValidation> const& m)
app_.getJobQueue ().addJob (
isTrusted ? jtVALIDATION_t : jtVALIDATION_ut,
"recvValidation->checkValidation",
[weak, val, isTrusted, m] (Job&)
[weak, val, m] (Job&)
{
if (auto peer = weak.lock())
peer->checkValidation(
val,
isTrusted,
m);
peer->checkValidation(val, m);
});
}
else
@@ -2248,13 +2245,12 @@ PeerImp::checkPropose (Job& job,
void
PeerImp::checkValidation (STValidation::pointer val,
bool isTrusted, std::shared_ptr<protocol::TMValidation> const& packet)
std::shared_ptr<protocol::TMValidation> const& packet)
{
try
{
// VFALCO Which functions throw?
uint256 signingHash = val->getSigningHash();
if (! cluster() && !val->isValid (signingHash))
if (! cluster() && !val->isValid())
{
JLOG(p_journal_.warn()) <<
"Validation is invalid";

View File

@@ -472,7 +472,7 @@ private:
void
checkValidation (STValidation::pointer val,
bool isTrusted, std::shared_ptr<protocol::TMValidation> const& packet);
std::shared_ptr<protocol::TMValidation> const& packet);
void
getLedger (std::shared_ptr<protocol::TMGetLedger> const&packet);

View File

@@ -184,9 +184,6 @@ public:
uint256
getSigningHash() const;
bool
isValid(uint256 const&) const;
void
setTrusted()
{

View File

@@ -103,19 +103,13 @@ NetClock::time_point STValidation::getSeenTime () const
}
bool STValidation::isValid () const
{
return isValid (getSigningHash ());
}
bool STValidation::isValid (uint256 const& signingHash) const
{
try
{
if (publicKeyType(getSignerPublic()) != KeyType::secp256k1)
return false;
return verifyDigest (getSignerPublic(),
signingHash,
return verifyDigest (getSignerPublic(), getSigningHash(),
makeSlice(getFieldVL (sfSignature)),
getFlags () & vfFullyCanonicalSig);
}