Merge branch 'develop' of github.com:jedmccaleb/NewCoin into develop

This commit is contained in:
JoelKatz
2013-05-26 14:57:27 -07:00
8 changed files with 20 additions and 11 deletions

BIN
LICENSE

Binary file not shown.

View File

@@ -2,7 +2,7 @@
#include <boost/foreach.hpp> #include <boost/foreach.hpp>
TaggedCache<uint256, AcceptedLedger> AcceptedLedger::ALCache("AcceptedLedger", 4, 60); TaggedCache<uint256, AcceptedLedger> AcceptedLedger::ALCache("AcceptedLedger", 8, 120);
ALTransaction::ALTransaction(uint32 seq, SerializerIterator& sit) ALTransaction::ALTransaction(uint32 seq, SerializerIterator& sit)
{ {

View File

@@ -107,14 +107,17 @@ LedgerAcquire::LedgerAcquire(const uint256& hash, uint32 seq) : PeerSet(hash, LE
tryLocal(); tryLocal();
} }
void LedgerAcquire::checkLocal() bool LedgerAcquire::checkLocal()
{ {
boost::recursive_mutex::scoped_lock sl(mLock); boost::recursive_mutex::scoped_lock sl(mLock);
if (isDone()) if (isDone())
return; return false;
if (tryLocal()) if (!tryLocal())
done(); return false;
done();
return true;
} }
bool LedgerAcquire::tryLocal() bool LedgerAcquire::tryLocal()
@@ -1064,13 +1067,20 @@ void LedgerAcquireMaster::gotFetchPack(Job&)
acquires.reserve(mLedgers.size()); acquires.reserve(mLedgers.size());
typedef std::pair<uint256, LedgerAcquire::pointer> u256_acq_pair; typedef std::pair<uint256, LedgerAcquire::pointer> u256_acq_pair;
BOOST_FOREACH(const u256_acq_pair& it, mLedgers) BOOST_FOREACH(const u256_acq_pair& it, mLedgers)
{
acquires.push_back(it.second); acquires.push_back(it.second);
}
} }
int completed = 0;
BOOST_FOREACH(const LedgerAcquire::pointer& acquire, acquires) BOOST_FOREACH(const LedgerAcquire::pointer& acquire, acquires)
{ {
acquire->checkLocal(); if (acquire->checkLocal())
++completed;
} }
if (completed > 0)
theApp->getLedgerMaster().resumeAcquiring();
} }
// vim:ts=4 // vim:ts=4

View File

@@ -130,7 +130,7 @@ public:
void addPeers(); void addPeers();
void awaitData(); void awaitData();
void noAwaitData(); void noAwaitData();
void checkLocal(); bool checkLocal();
typedef std::pair<ripple::TMGetObjectByHash::ObjectType, uint256> neededHash_t; typedef std::pair<ripple::TMGetObjectByHash::ObjectType, uint256> neededHash_t;
std::vector<neededHash_t> getNeededHashes(); std::vector<neededHash_t> getNeededHashes();

View File

@@ -2131,7 +2131,7 @@ void NetworkOPs::gotFetchPack(bool progress, uint32 seq)
mLastFetchPack = 0; mLastFetchPack = 0;
mFetchSeq = seq; // earliest pack we have data on mFetchSeq = seq; // earliest pack we have data on
theApp->getJobQueue().addJob(jtLEDGER_DATA, "gotFetchPack", theApp->getJobQueue().addJob(jtLEDGER_DATA, "gotFetchPack",
boost::bind(&LedgerAcquireMaster::gotFetchPack, &theApp->getMasterLedgerAcquire(), _1)); BIND_TYPE(&LedgerAcquireMaster::gotFetchPack, &theApp->getMasterLedgerAcquire(), P_1));
} }
void NetworkOPs::missingNodeInLedger(uint32 seq) void NetworkOPs::missingNodeInLedger(uint32 seq)

View File

@@ -3486,7 +3486,7 @@ Json::Value RPCHandler::doCommand(const Json::Value& jvRequest, int iRole, int &
{ "path_find", &RPCHandler::doPathFind, false, optCurrent }, { "path_find", &RPCHandler::doPathFind, false, optCurrent },
{ "ping", &RPCHandler::doPing, false, optNone }, { "ping", &RPCHandler::doPing, false, optNone },
// { "profile", &RPCHandler::doProfile, false, optCurrent }, // { "profile", &RPCHandler::doProfile, false, optCurrent },
{ "proof_create", &RPCHandler::doProofCreate, false, optNone }, { "proof_create", &RPCHandler::doProofCreate, true, optNone },
{ "proof_solve", &RPCHandler::doProofSolve, true, optNone }, { "proof_solve", &RPCHandler::doProofSolve, true, optNone },
{ "proof_verify", &RPCHandler::doProofVerify, true, optNone }, { "proof_verify", &RPCHandler::doProofVerify, true, optNone },
{ "random", &RPCHandler::doRandom, false, optNone }, { "random", &RPCHandler::doRandom, false, optNone },

View File

@@ -260,7 +260,6 @@ SHAMapTreeNode* SHAMap::getNodePointer(const SHAMapNode& id, const uint256& hash
} }
} }
void SHAMap::returnNode(SHAMapTreeNode::pointer& node, bool modify) void SHAMap::returnNode(SHAMapTreeNode::pointer& node, bool modify)
{ // make sure the node is suitable for the intended operation (copy on write) { // make sure the node is suitable for the intended operation (copy on write)
assert(node->isValid()); assert(node->isValid());

View File

@@ -126,7 +126,7 @@ std::vector<uint256> SHAMap::getNeededHashes(int max, SHAMapSyncFilter* filter)
try try
{ {
d = getNodePointer(childID, childHash, filter); d = getNodePointer(childID, childHash, filter);
if (d->isInner() && !d->isFullBelow()) if (d->isInner())
{ {
have_all = false; have_all = false;
stack.push(d); stack.push(d);