Skip to content

Commit 5c77e4d

Browse files
committed
Restore protocol version check in SorobanTransactionQueue::getMaxQueueSizeOps
1 parent 84444eb commit 5c77e4d

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/herder/TransactionQueue.cpp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,12 +1184,18 @@ SorobanTransactionQueue::broadcastSome()
11841184
size_t
11851185
SorobanTransactionQueue::getMaxQueueSizeOps() const
11861186
{
1187-
std::lock_guard<std::recursive_mutex> guard(mTxQueueMutex);
1188-
// TODO: I removed a conditional checking that the protocol version is
1189-
// post-soroban here. I think that check is now unnecessary, right?
1190-
auto res = mTxQueueLimiter.maxScaledLedgerResources(true);
1191-
releaseAssert(res.size() == NUM_SOROBAN_TX_RESOURCES);
1192-
return res.getVal(Resource::Type::OPERATIONS);
1187+
if (protocolVersionStartsFrom(
1188+
mBucketSnapshot->getLedgerHeader().ledgerVersion,
1189+
SOROBAN_PROTOCOL_VERSION))
1190+
{
1191+
auto res = mTxQueueLimiter.maxScaledLedgerResources(true);
1192+
releaseAssert(res.size() == NUM_SOROBAN_TX_RESOURCES);
1193+
return res.getVal(Resource::Type::OPERATIONS);
1194+
}
1195+
else
1196+
{
1197+
return 0;
1198+
}
11931199
}
11941200

11951201
bool

0 commit comments

Comments
 (0)