Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
-
data
TxSubmissionMempoolReader
txid tx idx m =
TxSubmissionMempoolReader
{
- mempoolGetSnapshot :: STM m ( MempoolSnapshot txid tx idx)
- mempoolZeroIdx :: idx
-
data
MempoolSnapshot
txid tx idx =
MempoolSnapshot
{
- mempoolTxIdsAfter :: idx -> [(txid, idx, TxSizeInBytes )]
- mempoolLookupTx :: idx -> Maybe tx
- mempoolHasTx :: txid -> Bool
- mapMempoolSnapshot :: (tx -> tx') -> MempoolSnapshot txid tx idx -> MempoolSnapshot txid tx' idx
- mapTxSubmissionMempoolReader :: MonadSTM m => (tx -> tx') -> TxSubmissionMempoolReader txid tx idx m -> TxSubmissionMempoolReader txid tx' idx m
Documentation
data TxSubmissionMempoolReader txid tx idx m Source #
The consensus layer functionality that the inbound and outbound side of the tx submission logic requires.
This is provided to the tx submission logic by the consensus layer.
TxSubmissionMempoolReader | |
|
data MempoolSnapshot txid tx idx Source #
A pure snapshot of the contents of the mempool. It allows fetching information about transactions in the mempool, and fetching individual transactions.
This uses a transaction sequence number type for identifying transactions within the mempool sequence. The sequence number is local to this mempool, unlike the transaction hash. This allows us to ask for all transactions after a known sequence number, to get new transactions. It is also used to look up individual transactions.
Note that it is expected that
mempoolLookupTx
will often return
Nothing
even for tx sequence numbers returned in previous snapshots. This happens
when the transaction has been removed from the mempool between snapshots.
MempoolSnapshot | |
|
mapMempoolSnapshot :: (tx -> tx') -> MempoolSnapshot txid tx idx -> MempoolSnapshot txid tx' idx Source #
mapTxSubmissionMempoolReader :: MonadSTM m => (tx -> tx') -> TxSubmissionMempoolReader txid tx idx m -> TxSubmissionMempoolReader txid tx' idx m Source #