Skip to content

Commit 2227d76

Browse files
committed
Refactor mempool limit
1 parent ecfb43c commit 2227d76

File tree

1 file changed

+4
-4
lines changed
  • ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Mempool

1 file changed

+4
-4
lines changed

ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Mempool/Update.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,10 @@ pureTryAddTx cfg txSize wti tx is
185185
-- mempool, and...
186186
| let curSize = msNumBytes $ isMempoolSize is
187187
, curSize < getMempoolCapacityBytes (isCapacity is)
188-
-- ... if the mempool has less than 2.5 mebibytes of ref scripts.
189-
, let maxTotalRefScriptSize = 5 * 512 * 1024 -- 2.5 Mebibytes
190-
curTotalRefScriptSize = isTotalRefScriptSize is
191-
, curTotalRefScriptSize Prelude.< maxTotalRefScriptSize
188+
, let curTotalRefScriptSize = isTotalRefScriptSize is
189+
newTxRefScriptSize = txRefScriptSize cfg (isLedgerState is) tx
190+
maxTotalRefScriptSize = 1024 * 1024 -- 1MiB
191+
, curTotalRefScriptSize + newTxRefScriptSize Prelude.<= maxTotalRefScriptSize
192192
=
193193
case eVtx of
194194
-- We only extended the ValidationResult with a single transaction

0 commit comments

Comments
 (0)