ouroboros-consensus-1.0.0.0: Consensus layer for the Ouroboros blockchain protocol
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.Mempool.Update

Description

Operations that update the mempool. They are internally divided in the pure and impure sides of the operation.

Synopsis

Documentation

data WhichAddTx (f ∷ TypeType) where Source #

A GADT that enables the shared implementation of addTx and testTryAddTx.

Constructors

ProductionAddTxWhichAddTx Identity 
TestingAddTx ∷ !DiffTimeWhichAddTx Maybe

The argument unique to testTryAddTx.

The Nothing result means the tx would not fit in the current mempool; the testing implementation gives up instead of retrying indefinitely.

implAddTx Source #

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.