Merge branch 'master' of github.com:jedmccaleb/NewCoin

This commit is contained in:
Arthur Britto
2013-03-09 15:35:54 -08:00
6 changed files with 30 additions and 6 deletions

View File

@@ -528,6 +528,8 @@ int PeerSet::getPeerCount() const
void LedgerAcquire::filterNodes(std::vector<SHAMapNode>& nodeIDs, std::vector<uint256>& nodeHashes,
std::set<SHAMapNode>& recentNodes, int max, bool aggressive)
{ // ask for new nodes in preference to ones we've already asked for
assert(nodeIDs.size() == nodeHashes.size());
std::vector<bool> duplicates;
duplicates.reserve(nodeIDs.size());

View File

@@ -1696,7 +1696,7 @@ Json::Value RPCHandler::doAccountTransactions(Json::Value jvRequest, int& cost)
try
{
#endif
int vl = mNetOps->getValidatedSeq();
unsigned int vl = mNetOps->getValidatedSeq();
ScopedUnlock su(theApp->getMasterLock());
Json::Value ret(Json::objectValue);
@@ -2729,11 +2729,25 @@ Json::Value RPCHandler::doSubscribe(Json::Value jvRequest, int& cost)
if(currencyIn.isNonZero())
STAmount::issuerFromString(issuerIn,(*it)["IssuerIn"].asString());
bool bothSides=false;
if((*it).isMember("BothSides") && (*it)["BothSides"].asBool()) bothSides=true;
mNetOps->subBook(ispSub, currencyIn, currencyOut, issuerIn, issuerOut);
if(bothSides) mNetOps->subBook(ispSub, currencyOut, currencyIn, issuerOut, issuerIn);
if((*it)["StateNow"].asBool())
{
//lpLedger = theApp->getLedgerMaster().getClosedLedger();
//mNetOps->getBookPage(lpLedger, uTakerPaysCurrencyID, uTakerPaysIssuerID, uTakerGetsCurrencyID, uTakerGetsIssuerID, raTakerID.getAccountID(), false, iLimit, jvMarker, jvResult);
Ledger::pointer ledger= theApp->getLedgerMaster().getClosedLedger();
RippleAddress raTakerID;
raTakerID.setAccountID(ACCOUNT_ONE);
const Json::Value jvMarker = Json::Value(Json::nullValue);
mNetOps->getBookPage(ledger, currencyOut, issuerOut, currencyIn, issuerIn, raTakerID.getAccountID(), false, 0, jvMarker, jvResult);
if(bothSides)
{
Json::Value tempJson(Json::objectValue);
if(jvResult.isMember("offers")) jvResult["bids"]=jvResult["offers"];
mNetOps->getBookPage(ledger, currencyIn, issuerIn, currencyOut, issuerOut, raTakerID.getAccountID(), false, 0, jvMarker, tempJson);
if(tempJson.isMember("offers")) jvResult["asks"]=tempJson["offers"];
}
}
}
}

View File

@@ -73,6 +73,7 @@ void SHAMap::getMissingNodes(std::vector<SHAMapNode>& nodeIDs, std::vector<uint2
{ // we need this node
have_all = false;
nodeIDs.push_back(childID);
hashes.push_back(childHash);
if (--max <= 0)
return;
}