| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Ouroboros.Consensus.Mempool.Update
Description
Operations that update the mempool. They are internally divided in the pure and impure sides of the operation.
Synopsis
- data WhichAddTx (f ∷ Type → Type) where
- implAddTx ∷ (IOLike m, MonadTimer m, LedgerSupportsMempool blk, HasTxId (GenTx blk)) ⇒ MempoolEnv m blk → WhichAddTx f → AddTxOnBehalfOf → GenTx blk → m (f (MempoolAddTxResult blk))
- implRemoveTxsEvenIfValid ∷ (IOLike m, LedgerSupportsMempool blk, HasTxId (GenTx blk)) ⇒ MempoolEnv m blk → NonEmpty (GenTxId blk) → m ()
- implSyncWithLedger ∷ (IOLike m, LedgerSupportsMempool blk, ValidateEnvelope blk, HasTxId (GenTx blk)) ⇒ MempoolEnv m blk → m (MempoolSnapshot blk)
Documentation
data WhichAddTx (f ∷ Type → Type) where Source #
A GADT that enables the shared implementation of addTx and testTryAddTx.
Constructors
| ProductionAddTx ∷ WhichAddTx Identity | |
| TestingAddTx ∷ !DiffTime → WhichAddTx Maybe | The argument unique to The |
Arguments
| ∷ (IOLike m, MonadTimer m, LedgerSupportsMempool blk, HasTxId (GenTx blk)) | |
| ⇒ MempoolEnv m blk | |
| → WhichAddTx f | |
| → AddTxOnBehalfOf | Whether we're acting on behalf of a remote peer or a local client. |
| → GenTx blk | The transaction to add to the mempool. |
| → m (f (MempoolAddTxResult blk)) |
Add a single transaction to the mempool.
If there is no space, then the ProductionAddTx caller will block until
there space, and try again, repeatedly until it succeeds. It only releases
the lock when this loop terminates.
If there is no space, the TestingAddTx caller will immediately return
Nothing.
implRemoveTxsEvenIfValid ∷ (IOLike m, LedgerSupportsMempool blk, HasTxId (GenTx blk)) ⇒ MempoolEnv m blk → NonEmpty (GenTxId blk) → m () Source #
See removeTxsEvenIfValid.
implSyncWithLedger ∷ (IOLike m, LedgerSupportsMempool blk, ValidateEnvelope blk, HasTxId (GenTx blk)) ⇒ MempoolEnv m blk → m (MempoolSnapshot blk) Source #
See syncWithLedger.