Skip to content

Commit 047acf2

Browse files
author
Mark Travis
committed
Review fixes (2) ximinez.
1 parent 624a09a commit 047acf2

File tree

3 files changed

+18
-16
lines changed

3 files changed

+18
-16
lines changed

Builds/CMake/RippledCore.cmake

+1
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ install (
163163
src/ripple/basics/Slice.h
164164
src/ripple/basics/spinlock.h
165165
src/ripple/basics/StringUtilities.h
166+
src/ripple/basics/SubmitSync.h
166167
src/ripple/basics/ThreadSafetyAnalysis.h
167168
src/ripple/basics/ToString.h
168169
src/ripple/basics/UnorderedContainers.h

src/ripple/app/ledger/impl/LedgerMaster.cpp

+17-15
Original file line numberDiff line numberDiff line change
@@ -550,22 +550,24 @@ LedgerMaster::applyHeldTransactions()
550550
{
551551
std::lock_guard sl(m_mutex);
552552
// It can be expensive to modify the open ledger even with no transactions
553-
// to process.
554-
if (!mHeldTransactions.size())
555-
return;
556-
557-
app_.openLedger().modify([&](OpenView& view, beast::Journal j) {
558-
bool any = false;
559-
for (auto const& it : mHeldTransactions)
553+
// to process. Regardless, make sure to reset held transactions with
554+
// the parent.
555+
if (mHeldTransactions.size())
556+
{
557+
app_.openLedger().modify([&](OpenView &view, beast::Journal j)
560558
{
561-
ApplyFlags flags = tapNONE;
562-
auto const result =
563-
app_.getTxQ().apply(app_, view, it.second, flags, j);
564-
if (result.second)
565-
any = true;
566-
}
567-
return any;
568-
});
559+
bool any = false;
560+
for (auto const &it: mHeldTransactions)
561+
{
562+
ApplyFlags flags = tapNONE;
563+
auto const result =
564+
app_.getTxQ().apply(app_, view, it.second, flags, j);
565+
if (result.second)
566+
any = true;
567+
}
568+
return any;
569+
});
570+
}
569571

570572
// VFALCO TODO recreate the CanonicalTxSet object instead of resetting
571573
// it.

src/test/jtx/Env_test.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,6 @@ class Env_test : public beast::unit_test::suite
965965
payment = noop("alice");
966966
payment[sfSequence.fieldName] = env.seq("alice");
967967
payment[sfSetFlag.fieldName] = 0;
968-
auto req = payment;
969968
jr = applyJsonTxn(RPC::SubmitSync::sync, secret, payment);
970969
BEAST_EXPECT(jr[jss::result][jss::engine_result] == "tesSUCCESS");
971970

0 commit comments

Comments
 (0)