Last part of the fetch pack code.

This commit is contained in:
JoelKatz
2013-04-22 06:56:11 -07:00
parent b3bd10c078
commit 8a368204c1
16 changed files with 160 additions and 38 deletions

View File

@@ -36,6 +36,8 @@ Peer::Peer(boost::asio::io_service& io_service, boost::asio::ssl::context& ctx,
mPeerId(peerID),
mPrivate(false),
mLoad(""),
mMinLedger(0),
mMaxLedger(0),
mSocketSsl(io_service, ctx),
mActivityTimer(io_service),
mIOStrand(io_service)
@@ -1381,6 +1383,11 @@ void Peer::recvStatus(ripple::TMStatusChange& packet)
addLedger(mPreviousLedgerHash);
}
else mPreviousLedgerHash.zero();
if (packet.has_firstseq())
mMinLedger = packet.firstseq();
if (packet.has_lastseq())
mMaxLedger = packet.lastseq();
}
void Peer::recvGetLedger(ripple::TMGetLedger& packet)
@@ -1877,6 +1884,11 @@ void Peer::doFetchPack(const boost::shared_ptr<ripple::TMGetObjectByHash>& packe
}
}
bool Peer::hasProto(int version)
{
return mHello.has_protoversion() && (mHello.protoversion() >= version);
}
Json::Value Peer::getJson()
{
Json::Value ret(Json::objectValue);