mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Merge branch 'master' of github.com:jedmccaleb/NewCoin
This commit is contained in:
@@ -323,7 +323,10 @@ void LedgerConsensus::statusChange(newcoin::NodeEvent event, Ledger::pointer led
|
||||
{ // Send a node status change message to our peers
|
||||
newcoin::TMStatusChange s;
|
||||
if (!mHaveCorrectLCL)
|
||||
{
|
||||
Log(lsTRACE) << "Telling peers we have lost sync";
|
||||
s.set_newevent(newcoin::neLOST_SYNC);
|
||||
}
|
||||
else
|
||||
{
|
||||
s.set_newevent(event);
|
||||
|
||||
@@ -372,8 +372,11 @@ bool NetworkOPs::checkLastClosedLedger(const std::vector<Peer::pointer>& peerLis
|
||||
Ledger::pointer currentClosed = mLedgerMaster->getClosedLedger();
|
||||
uint256 closedLedger = currentClosed->getHash();
|
||||
ValidationCount& ourVC = ledgers[closedLedger];
|
||||
++ourVC.nodesUsing;
|
||||
ourVC.highNode = theApp->getWallet().getNodePublic();
|
||||
if (mHaveLCL)
|
||||
{
|
||||
++ourVC.nodesUsing;
|
||||
ourVC.highNode = theApp->getWallet().getNodePublic();
|
||||
}
|
||||
|
||||
for (std::vector<Peer::pointer>::const_iterator it = peerList.begin(), end = peerList.end(); it != end; ++it)
|
||||
{
|
||||
@@ -575,7 +578,10 @@ void NetworkOPs::endConsensus()
|
||||
std::vector<Peer::pointer> peerList = theApp->getConnectionPool().getPeerVector();
|
||||
for (std::vector<Peer::pointer>::const_iterator it = peerList.begin(), end = peerList.end(); it != end; ++it)
|
||||
if (*it && ((*it)->getClosedLedgerHash() == deadLedger))
|
||||
{
|
||||
Log(lsTRACE) << "Killing obsolete peer status";
|
||||
(*it)->cycleStatus();
|
||||
}
|
||||
mConsensus = boost::shared_ptr<LedgerConsensus>();
|
||||
}
|
||||
|
||||
|
||||
@@ -857,8 +857,10 @@ void Peer::recvStatus(newcoin::TMStatusChange& packet)
|
||||
|
||||
if (packet.newevent() == newcoin::neLOST_SYNC)
|
||||
{
|
||||
Log(lsTRACE) << "peer has lost sync";
|
||||
mPreviousLedgerHash.zero();
|
||||
mClosedLedgerHash.zero();
|
||||
return;
|
||||
}
|
||||
if (packet.has_ledgerhash() && (packet.ledgerhash().size() == (256 / 8)))
|
||||
{ // a peer has changed ledgers
|
||||
@@ -866,7 +868,12 @@ void Peer::recvStatus(newcoin::TMStatusChange& packet)
|
||||
mClosedLedgerTime = ptFromSeconds(packet.networktime());
|
||||
Log(lsTRACE) << "peer LCL is " << mClosedLedgerHash.GetHex();
|
||||
}
|
||||
else mClosedLedgerHash.zero();
|
||||
else
|
||||
{
|
||||
Log(lsTRACE) << "peer has no ledger hash";
|
||||
mClosedLedgerHash.zero();
|
||||
}
|
||||
|
||||
if (packet.has_previousledgerhash() && packet.previousledgerhash().size() == (256 / 8))
|
||||
{
|
||||
memcpy(mPreviousLedgerHash.begin(), packet.previousledgerhash().data(), 256 / 8);
|
||||
|
||||
@@ -87,8 +87,8 @@ boost::unordered_map<uint256, int> ValidationCollection::getCurrentValidations()
|
||||
{
|
||||
if (now > (it->second->getCloseTime() + LEDGER_INTERVAL))
|
||||
{
|
||||
it = mCurrentValidations.erase(it);
|
||||
Log(lsTRACE) << "Erasing validation for " << it->second->getLedgerHash().GetHex();
|
||||
it = mCurrentValidations.erase(it);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user