mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Code to determine how old a proposal is.
Low-level code to remove a peer from the consensus process.
This commit is contained in:
@@ -161,6 +161,18 @@ void LCTransaction::setVote(const uint160& peer, bool votesYes)
|
||||
}
|
||||
}
|
||||
|
||||
void LCTransaction::unVote(const uint160& peer)
|
||||
{
|
||||
boost::unordered_map<uint160, bool>::iterator it = mVotes.find(peer);
|
||||
if (it != mVotes.end())
|
||||
{
|
||||
if (it->second)
|
||||
--mYays;
|
||||
else
|
||||
--mNays;
|
||||
}
|
||||
}
|
||||
|
||||
bool LCTransaction::updatePosition(int percentTime, bool proposing)
|
||||
{ // this many seconds after close, should our position change
|
||||
if (mOurPosition && (mNays == 0))
|
||||
@@ -766,6 +778,13 @@ bool LedgerConsensus::peerPosition(const LedgerProposal::pointer& newPosition)
|
||||
return true;
|
||||
}
|
||||
|
||||
void LedgerConsensus::removePeer(const uint160& peerID)
|
||||
{
|
||||
mPeerPositions.erase(peerID);
|
||||
BOOST_FOREACH(u256_lct_pair& it, mDisputes)
|
||||
it.second->unVote(peerID);
|
||||
}
|
||||
|
||||
bool LedgerConsensus::peerHasSet(const Peer::pointer& peer, const uint256& hashSet, newcoin::TxSetStatus status)
|
||||
{
|
||||
if (status != newcoin::tsHAVE) // Indirect requests are for future support
|
||||
|
||||
Reference in New Issue
Block a user