mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Some trivial cleanups/fixes:
* Avoid throwing in OrderBookDB::processTxn * Fix missing space in debug output * Avoid duplicate lock of PathRequest in updateAll * Avoid shadowing in insertPathRequest * Improve indentation in runOnCoroutine * Remove extraneous space in ServerHandlerImp::processRequest
This commit is contained in:
@@ -257,7 +257,9 @@ void OrderBookDB::processTxn (
|
|||||||
auto data = dynamic_cast<const STObject*> (
|
auto data = dynamic_cast<const STObject*> (
|
||||||
node.peekAtPField (*field));
|
node.peekAtPField (*field));
|
||||||
|
|
||||||
if (data)
|
if (data &&
|
||||||
|
data->isFieldPresent (sfTakerPays) &&
|
||||||
|
data->isFieldPresent (sfTakerGets))
|
||||||
{
|
{
|
||||||
// determine the OrderBook
|
// determine the OrderBook
|
||||||
auto listeners = getBookListeners (
|
auto listeners = getBookListeners (
|
||||||
|
|||||||
@@ -113,8 +113,6 @@ void PathRequests::updateAll (std::shared_ptr <ReadView const> const& inLedger,
|
|||||||
|
|
||||||
if (remove)
|
if (remove)
|
||||||
{
|
{
|
||||||
PathRequest::pointer pRequest = wRequest.lock ();
|
|
||||||
|
|
||||||
ScopedLockType sl (mLock);
|
ScopedLockType sl (mLock);
|
||||||
|
|
||||||
// Remove any dangling weak pointers or weak pointers that refer to this path request.
|
// Remove any dangling weak pointers or weak pointers that refer to this path request.
|
||||||
@@ -179,8 +177,8 @@ void PathRequests::insertPathRequest (PathRequest::pointer const& req)
|
|||||||
std::vector<PathRequest::wptr>::iterator it = mRequests.begin ();
|
std::vector<PathRequest::wptr>::iterator it = mRequests.begin ();
|
||||||
while (it != mRequests.end ())
|
while (it != mRequests.end ())
|
||||||
{
|
{
|
||||||
PathRequest::pointer req = it->lock ();
|
PathRequest::pointer r = it->lock ();
|
||||||
if (req && !req->isNew ())
|
if (r && !r->isNew ())
|
||||||
break; // This request has been handled, we come before it
|
break; // This request has been handled, we come before it
|
||||||
|
|
||||||
// This is a newer request, we come after it
|
// This is a newer request, we come after it
|
||||||
|
|||||||
@@ -52,8 +52,10 @@ void runOnCoroutineImpl(std::shared_ptr<Pull> pull)
|
|||||||
|
|
||||||
void runOnCoroutine(Coroutine const& coroutine)
|
void runOnCoroutine(Coroutine const& coroutine)
|
||||||
{
|
{
|
||||||
auto pullFunction = [coroutine] (Push& push) {
|
auto pullFunction = [coroutine] (Push& push)
|
||||||
Suspend suspend = [&push] (CoroutineType const& cbc) {
|
{
|
||||||
|
Suspend suspend = [&push] (CoroutineType const& cbc)
|
||||||
|
{
|
||||||
if (push)
|
if (push)
|
||||||
push (cbc);
|
push (cbc);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user