diff --git a/src/NetworkOPs.cpp b/src/NetworkOPs.cpp index 88b7af0cab..ce50a11888 100644 --- a/src/NetworkOPs.cpp +++ b/src/NetworkOPs.cpp @@ -190,6 +190,7 @@ STVector256 NetworkOPs::getDirNodeInfo( uNodePrevious = sleNode->getIFieldU64(sfIndexPrevious); uNodeNext = sleNode->getIFieldU64(sfIndexNext); + svIndexes = sleNode->getIFieldV256(sfIndexes); Log(lsTRACE) << "getDirNodeInfo: first: " << strHex(uNodePrevious); Log(lsTRACE) << "getDirNodeInfo: last: " << strHex(uNodeNext); diff --git a/src/RPCServer.cpp b/src/RPCServer.cpp index 68aab99bf0..1605fe93cf 100644 --- a/src/RPCServer.cpp +++ b/src/RPCServer.cpp @@ -264,6 +264,7 @@ Json::Value RPCServer::getMasterGenerator(const uint256& uLedger, const NewcoinA // <-- naAccountPrivate : Regular private key for naSrcAccountID // <-- saSrcBalance: Balance minus fee. // --> naVerifyGenerator : If provided, the found master public generator must match. +// XXX Be more lenient, allow use of master generator on claimed accounts. Json::Value RPCServer::authorize(const uint256& uLedger, const NewcoinAddress& naRegularSeed, const NewcoinAddress& naSrcAccountID, NewcoinAddress& naAccountPublic, NewcoinAddress& naAccountPrivate, @@ -303,7 +304,6 @@ Json::Value RPCServer::authorize(const uint256& uLedger, unsigned int iIndex = 0; bool bFound = false; - // XXX Stop after Config.account_probe_max // Don't look at ledger entries to determine if the account exists. Don't want to leak to thin server that these accounts are // related. while (!bFound && iIndex != theConfig.ACCOUNT_PROBE_MAX) @@ -1086,11 +1086,13 @@ Json::Value RPCServer::doRippleLinesGet(const Json::Value ¶ms) ret["account"] = naAccount.humanAccountID(); + // XXX This is wrong, we do access the current ledger and do need to worry about changes. // We access a committed ledger and need not worry about changes. uint256 uRootIndex; if (mNetOps->getDirLineInfo(uCurrent, naAccount, uRootIndex)) { + Log(lsINFO) << "doRippleLinesGet: dir root index: " << uRootIndex.ToString(); bool bDone = false; while (!bDone) @@ -1099,6 +1101,10 @@ Json::Value RPCServer::doRippleLinesGet(const Json::Value ¶ms) uint64 uNodeNext; STVector256 svRippleNodes = mNetOps->getDirNodeInfo(uCurrent, uRootIndex, uNodePrevious, uNodeNext); + Log(lsINFO) << "doRippleLinesGet: previous: " << strHex(uNodePrevious); + Log(lsINFO) << "doRippleLinesGet: next: " << strHex(uNodeNext); + Log(lsINFO) << "doRippleLinesGet: lines: " << svRippleNodes.peekValue().size(); + BOOST_FOREACH(uint256& uNode, svRippleNodes.peekValue()) { NewcoinAddress naAccountPeer; @@ -1106,6 +1112,8 @@ Json::Value RPCServer::doRippleLinesGet(const Json::Value ¶ms) STAmount saLimit; STAmount saLimitPeer; + Log(lsINFO) << "doRippleLinesGet: line index: " << uNode.ToString(); + RippleState::pointer rsLine = mNetOps->getRippleState(uCurrent, uNode); if (rsLine) @@ -1130,7 +1138,7 @@ Json::Value RPCServer::doRippleLinesGet(const Json::Value ¶ms) } else { - std::cerr << "doAccountLines: Bad index: " << uNode.ToString() << std::endl; + Log(lsWARNING) << "doRippleLinesGet: Bad index: " << uNode.ToString(); } } @@ -1144,11 +1152,15 @@ Json::Value RPCServer::doRippleLinesGet(const Json::Value ¶ms) } } } + else + { + Log(lsINFO) << "doRippleLinesGet: no directory: " << uRootIndex.ToString(); + } ret["lines"] = jsonLines; } else { - ret["status"] = "NotFound"; + ret = RPCError(rpcACT_NOT_FOUND); } return ret; @@ -1234,6 +1246,7 @@ Json::Value RPCServer::doSend(const Json::Value& params) return RPCError(rpcINSUF_FUNDS); } + // XXX Don't allow send to self of same currency. Transaction::pointer trans;