diff --git a/src/cpp/ripple/LedgerEntrySet.cpp b/src/cpp/ripple/LedgerEntrySet.cpp index 9c51bcaa65..beb34a19d3 100644 --- a/src/cpp/ripple/LedgerEntrySet.cpp +++ b/src/cpp/ripple/LedgerEntrySet.cpp @@ -985,7 +985,7 @@ TER LedgerEntrySet::offerDelete(SLE::ref sleOffer, const uint256& uOfferIndex, c TER LedgerEntrySet::offerDelete(const uint256& uOfferIndex) { SLE::pointer sleOffer = entryCache(ltOFFER, uOfferIndex); - const uint160 uOwnerID = sleOffer->getFieldAccount(sfAccount).getAccountID(); + const uint160 uOwnerID = sleOffer->getFieldAccount160(sfAccount); return offerDelete(sleOffer, uOfferIndex, uOwnerID); } diff --git a/src/cpp/ripple/NetworkOPs.cpp b/src/cpp/ripple/NetworkOPs.cpp index f971bac21f..5d0e272684 100644 --- a/src/cpp/ripple/NetworkOPs.cpp +++ b/src/cpp/ripple/NetworkOPs.cpp @@ -1864,11 +1864,13 @@ void NetworkOPs::getBookPage(Ledger::pointer lpLedger, const uint160& uTakerPays unsigned int uBookEntry; STAmount saDirRate; -// unsigned int iLeft = iLimit; + unsigned int iLeft = iLimit; + if ((iLeft == 0) || (iLeft > 300)) + iLeft = 300; uint32 uTransferRate = lesActive.rippleTransferRate(uTakerGetsIssuerID); - while (!bDone) { + while (!bDone && (iLeft > 0)) { if (bDirectAdvance) { bDirectAdvance = false; @@ -1896,7 +1898,7 @@ void NetworkOPs::getBookPage(Ledger::pointer lpLedger, const uint160& uTakerPays if (!bDone) { SLE::pointer sleOffer = lesActive.entryCache(ltOFFER, uOfferIndex); - const uint160 uOfferOwnerID = sleOffer->getFieldAccount(sfAccount).getAccountID(); + const uint160 uOfferOwnerID = sleOffer->getFieldAccount160(sfAccount); const STAmount& saTakerGets = sleOffer->getFieldAmount(sfTakerGets); const STAmount& saTakerPays = sleOffer->getFieldAmount(sfTakerPays); STAmount saOwnerFunds; @@ -1985,6 +1987,7 @@ void NetworkOPs::getBookPage(Ledger::pointer lpLedger, const uint160& uTakerPays // Only provide funded offers and offers of the taker. Json::Value& jvOf = jvOffers.append(jvOffer); jvOf["quality"] = saDirRate.getText(); + --iLeft; } if (!lesActive.dirNext(uTipIndex, sleOfferDir, uBookEntry, uOfferIndex)) diff --git a/src/cpp/ripple/OfferCreateTransactor.cpp b/src/cpp/ripple/OfferCreateTransactor.cpp index c7ce3e0ac1..5abb874d48 100644 --- a/src/cpp/ripple/OfferCreateTransactor.cpp +++ b/src/cpp/ripple/OfferCreateTransactor.cpp @@ -212,7 +212,7 @@ TER OfferCreateTransactor::takeOffers( cLog(lsDEBUG) << "takeOffers: considering offer : " << sleOffer->getJson(0); - const uint160 uOfferOwnerID = sleOffer->getFieldAccount(sfAccount).getAccountID(); + const uint160 uOfferOwnerID = sleOffer->getFieldAccount160(sfAccount); STAmount saOfferPays = sleOffer->getFieldAmount(sfTakerGets); STAmount saOfferGets = sleOffer->getFieldAmount(sfTakerPays); diff --git a/src/cpp/ripple/RippleCalc.cpp b/src/cpp/ripple/RippleCalc.cpp index 22da827e0f..8741d1d585 100644 --- a/src/cpp/ripple/RippleCalc.cpp +++ b/src/cpp/ripple/RippleCalc.cpp @@ -978,7 +978,7 @@ TER RippleCalc::calcNodeAdvance( { // Got a new offer. sleOffer = lesActive.entryCache(ltOFFER, uOfferIndex); - uOfrOwnerID = sleOffer->getFieldAccount(sfAccount).getAccountID(); + uOfrOwnerID = sleOffer->getFieldAccount160(sfAccount); saTakerPays = sleOffer->getFieldAmount(sfTakerPays); saTakerGets = sleOffer->getFieldAmount(sfTakerGets); @@ -3136,7 +3136,7 @@ void TransactionEngine::calcOfferBridgeNext( SLE::pointer sleOffer = entryCache(ltOFFER, uOfferIndex); - uint160 uOfferOwnerID = sleOffer->getFieldAccount(sfAccount).getAccountID(); + uint160 uOfferOwnerID = sleOffer->getFieldAccount160(sfAccount); STAmount saOfferPays = sleOffer->getFieldAmount(sfTakerGets); STAmount saOfferGets = sleOffer->getFieldAmount(sfTakerPays); diff --git a/src/cpp/ripple/TransactionCheck.cpp b/src/cpp/ripple/TransactionCheck.cpp index 2d4a0f8ea4..0b4f5c1f5f 100644 --- a/src/cpp/ripple/TransactionCheck.cpp +++ b/src/cpp/ripple/TransactionCheck.cpp @@ -9,12 +9,11 @@ SETUP_LOG(); bool TransactionEngine::checkInvariants(TER result, const SerializedTransaction& txn, TransactionEngineParams params) { #if 0 - const RippleAddress& srcAccount = txn.getFieldAccount(sfAccount); uint32 txnSeq = txn.getFieldU32(sfSequence); LedgerEntryAction leaAction; - uint256 srcActId = Ledger::getAccountRootIndex(srcAccount.getAccountID()); + uint256 srcActId = Ledger::getAccountRootIndex(txn.getFieldAccount(sfAccount)); SLE::pointer origSrcAct = mLedger->getSLE(srcActId); SLE::pointer newSrcAct = mNodes.getEntry(srcActId, leaAction); diff --git a/src/cpp/ripple/Transactor.cpp b/src/cpp/ripple/Transactor.cpp index b9068e5047..82b8ab9bce 100644 --- a/src/cpp/ripple/Transactor.cpp +++ b/src/cpp/ripple/Transactor.cpp @@ -97,7 +97,7 @@ TER Transactor::checkSig() { // Consistency: Check signature // Verify the transaction's signing public key is the key authorized for signing. - if (mHasAuthKey && mSigningPubKey.getAccountID() == mTxnAccount->getFieldAccount(sfRegularKey).getAccountID()) + if (mHasAuthKey && mSigningPubKey.getAccountID() == mTxnAccount->getFieldAccount160(sfRegularKey)) { // Authorized to continue. nothing();