Skip to content

Commit

Permalink
Log InboundLedgers::acquire
Browse files Browse the repository at this point in the history
  • Loading branch information
mtrippled committed Aug 21, 2024
1 parent 083da33 commit 49e2428
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/xrpld/app/ledger/detail/InboundLedgers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,27 @@ class InboundLedgersImp : public InboundLedgers
std::uint32_t seq,
InboundLedger::Reason reason) override
{
JLOG(j_.debug()) << "InboundLedgers::acquire1 " << this;
assert(hash.isNonZero());

// probably not the right rule
if (app_.getOPs().isNeedNetworkLedger() &&
(reason != InboundLedger::Reason::GENERIC) &&
(reason != InboundLedger::Reason::CONSENSUS))
{
JLOG(j_.debug()) << "InboundLedgers::acquire2 " << this;
return {};
}

bool isNew = true;
std::shared_ptr<InboundLedger> inbound;
{
JLOG(j_.debug()) << "InboundLedgers::acquire3 " << this;
ScopedLockType sl(mLock);
JLOG(j_.debug()) << "InboundLedgers::acquire4 " << this;
if (stopping_)
{
JLOG(j_.debug()) << "InboundLedgers::acquire5 " << this;
return {};
}

Expand All @@ -107,14 +114,23 @@ class InboundLedgersImp : public InboundLedgers
}

if (inbound->isFailed())
{
JLOG(j_.debug()) << "InboundLedgers::acquire6 " << this;
return {};
}

if (!isNew)
{
inbound->update(seq);
}

if (!inbound->isComplete())
{
JLOG(j_.debug()) << "InboundLedgers::acquire7 " << this;
return {};
}

JLOG(j_.debug()) << "InboundLedgers::acquire8 " << this;
return inbound->getLedger();
}

Expand Down

0 comments on commit 49e2428

Please sign in to comment.