mirror of
https://github.com/Xahau/xahaud.git
synced 2025-11-29 23:15:49 +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*> (
|
||||
node.peekAtPField (*field));
|
||||
|
||||
if (data)
|
||||
if (data &&
|
||||
data->isFieldPresent (sfTakerPays) &&
|
||||
data->isFieldPresent (sfTakerGets))
|
||||
{
|
||||
// determine the OrderBook
|
||||
auto listeners = getBookListeners (
|
||||
|
||||
@@ -670,7 +670,7 @@ public:
|
||||
{
|
||||
// A new ledger has been accepted as part of the trusted chain
|
||||
JLOG (m_journal.debug) << "Ledger " << ledger->info().seq
|
||||
<< "accepted :" << ledger->getHash ();
|
||||
<< " accepted :" << ledger->getHash ();
|
||||
assert (ledger->stateMap().getHash ().isNonZero ());
|
||||
|
||||
ledger->setValidated();
|
||||
|
||||
@@ -113,8 +113,6 @@ void PathRequests::updateAll (std::shared_ptr <ReadView const> const& inLedger,
|
||||
|
||||
if (remove)
|
||||
{
|
||||
PathRequest::pointer pRequest = wRequest.lock ();
|
||||
|
||||
ScopedLockType sl (mLock);
|
||||
|
||||
// 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 ();
|
||||
while (it != mRequests.end ())
|
||||
{
|
||||
PathRequest::pointer req = it->lock ();
|
||||
if (req && !req->isNew ())
|
||||
PathRequest::pointer r = it->lock ();
|
||||
if (r && !r->isNew ())
|
||||
break; // This request has been handled, we come before 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)
|
||||
{
|
||||
auto pullFunction = [coroutine] (Push& push) {
|
||||
Suspend suspend = [&push] (CoroutineType const& cbc) {
|
||||
auto pullFunction = [coroutine] (Push& push)
|
||||
{
|
||||
Suspend suspend = [&push] (CoroutineType const& cbc)
|
||||
{
|
||||
if (push)
|
||||
push (cbc);
|
||||
};
|
||||
|
||||
@@ -347,7 +347,7 @@ ServerHandlerImp::processRequest (
|
||||
|
||||
// Provide the JSON-RPC method as the field "command" in the request.
|
||||
params[jss::command] = strMethod;
|
||||
JLOG (m_journal.trace)
|
||||
JLOG (m_journal.trace)
|
||||
<< "doRpcCommand:" << strMethod << ":" << params;
|
||||
|
||||
auto const start (std::chrono::high_resolution_clock::now ());
|
||||
|
||||
Reference in New Issue
Block a user