diff --git a/src/ripple/overlay/impl/PeerImp.cpp b/src/ripple/overlay/impl/PeerImp.cpp index 3dbc6e289..c627fa0ff 100644 --- a/src/ripple/overlay/impl/PeerImp.cpp +++ b/src/ripple/overlay/impl/PeerImp.cpp @@ -1917,13 +1917,10 @@ PeerImp::onMessage (std::shared_ptr 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 const& packet) + std::shared_ptr 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"; diff --git a/src/ripple/overlay/impl/PeerImp.h b/src/ripple/overlay/impl/PeerImp.h index c7aa95b40..a066aeb1e 100644 --- a/src/ripple/overlay/impl/PeerImp.h +++ b/src/ripple/overlay/impl/PeerImp.h @@ -472,7 +472,7 @@ private: void checkValidation (STValidation::pointer val, - bool isTrusted, std::shared_ptr const& packet); + std::shared_ptr const& packet); void getLedger (std::shared_ptr const&packet); diff --git a/src/ripple/protocol/STValidation.h b/src/ripple/protocol/STValidation.h index 644c9500b..a998c9254 100644 --- a/src/ripple/protocol/STValidation.h +++ b/src/ripple/protocol/STValidation.h @@ -184,9 +184,6 @@ public: uint256 getSigningHash() const; - bool - isValid(uint256 const&) const; - void setTrusted() { diff --git a/src/ripple/protocol/impl/STValidation.cpp b/src/ripple/protocol/impl/STValidation.cpp index 92e92c6b9..1e1934be9 100644 --- a/src/ripple/protocol/impl/STValidation.cpp +++ b/src/ripple/protocol/impl/STValidation.cpp @@ -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); }