Better logging of untrusted validations. (To make sure there's no bug.)

This commit is contained in:
JoelKatz
2013-03-21 06:03:47 -07:00
parent b0c694195c
commit cd14be1afb
6 changed files with 18 additions and 10 deletions

View File

@@ -1056,8 +1056,16 @@ static void checkValidation(Job&, SerializedValidation::pointer val, uint256 sig
return;
}
std::string source;
Peer::pointer lp = peer.lock();
if (lp)
source = lp->getDisplayName();
else
source = "unknown";
std::set<uint64> peers;
if (theApp->getOPs().recvValidation(val) && theApp->getSuppression().swapSet(signingHash, peers, SF_RELAYED))
if (theApp->getOPs().recvValidation(val, source) &&
theApp->getSuppression().swapSet(signingHash, peers, SF_RELAYED))
{
PackedMessage::pointer message = boost::make_shared<PackedMessage>(*packet, ripple::mtVALIDATION);
theApp->getConnectionPool().relayMessageBut(peers, message);