mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Use validations.
This commit is contained in:
@@ -308,11 +308,18 @@ void NetworkOPs::checkState(const boost::system::error_code& result)
|
||||
if (!!peerLedger)
|
||||
{
|
||||
// FIXME: If we have this ledger, don't count it if it's too far past its close time
|
||||
bool isNew = ledgers.find(peerLedger) == ledgers.end();
|
||||
ValidationCount& vc = ledgers[peerLedger];
|
||||
if (isNew)
|
||||
{
|
||||
theApp->getValidations().getValidationCount(peerLedger,
|
||||
vc.trustedValidations, vc.untrustedValidations);
|
||||
Log(lsTRACE) << peerLedger.GetHex() << " has " << vc.trustedValidations <<
|
||||
" trusted validations and " << vc.untrustedValidations << " untrusted";
|
||||
}
|
||||
if ((vc.nodesUsing == 0) || ((*it)->getNodePublic() > vc.highNode))
|
||||
vc.highNode = (*it)->getNodePublic();
|
||||
++vc.nodesUsing;
|
||||
// WRITEME: Validations, trusted peers
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -533,8 +540,8 @@ void NetworkOPs::setMode(OperatingMode om)
|
||||
if (mMode == om) return;
|
||||
Log l((om < mMode) ? lsWARNING : lsINFO);
|
||||
if (om == omDISCONNECTED) l << "STATE->Disonnected";
|
||||
else if (om==omCONNECTED) l << "STATE->Connected";
|
||||
else if (om==omTRACKING) l << "STATE->Tracking";
|
||||
else if (om == omCONNECTED) l << "STATE->Connected";
|
||||
else if (om == omTRACKING) l << "STATE->Tracking";
|
||||
else l << "STATE->Full";
|
||||
mMode = om;
|
||||
}
|
||||
@@ -562,4 +569,9 @@ std::vector< std::pair<uint32, uint256> >
|
||||
return affectedAccounts;
|
||||
}
|
||||
|
||||
bool NetworkOPs::recvValidation(SerializedValidation::pointer val)
|
||||
{
|
||||
return theApp->getValidations().addValidation(val);
|
||||
}
|
||||
|
||||
// vim:ts=4
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "AccountState.h"
|
||||
#include "RippleState.h"
|
||||
#include "NicknameState.h"
|
||||
#include "SerializedValidation.h"
|
||||
|
||||
// #include <boost/asio.hpp>
|
||||
|
||||
@@ -115,6 +116,7 @@ public:
|
||||
const std::string& pubKey, const std::string& signature);
|
||||
bool gotTXData(boost::shared_ptr<Peer> peer, const uint256& hash,
|
||||
const std::list<SHAMapNode>& nodeIDs, const std::list< std::vector<unsigned char> >& nodeData);
|
||||
bool recvValidation(SerializedValidation::pointer val);
|
||||
SHAMap::pointer getTXMap(const uint256& hash);
|
||||
bool hasTXSet(boost::shared_ptr<Peer> peer, const uint256& set, newcoin::TxSetStatus status);
|
||||
void mapComplete(const uint256& hash, SHAMap::pointer map);
|
||||
|
||||
Reference in New Issue
Block a user