File tree 2 files changed +7
-0
lines changed
ouroboros-network/src/Ouroboros/Network/TxSubmission/Inbound
2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -100,6 +100,10 @@ data PeerTxAPI m txid tx = PeerTxAPI {
100
100
101
101
withMempoolSem :: m (Either (txid , tx ) (txid , tx ))
102
102
-> m (Either (txid , tx ) (txid , tx ))
103
+ -- TODO:
104
+ -- the split into `addTx` in the `Server` and `withMempoolSem` is artificial.
105
+ -- Better exose: `addTxToMempool :: txid -> tx -> m ()` which composes both
106
+ -- actions. We can ignore the result, since it is ignored in the `Server`.
103
107
}
104
108
105
109
@@ -239,6 +243,7 @@ withPeer tracer
239
243
inflightTxs' = foldl' purgeInflightTxs inflightTxs requestedTxsInflight
240
244
inflightTxsSize' = inflightTxsSize - requestedTxsInflightSize
241
245
246
+ -- TODO: describe why we need to add `toMempoolTxs` to `limboTxs`.
242
247
limboTxs' =
243
248
foldl' (flip $ Map. update
244
249
\ cnt -> if cnt > 1
Original file line number Diff line number Diff line change @@ -145,6 +145,7 @@ acknowledgeTxIds
145
145
, 0
146
146
, TxsToMempool []
147
147
, RefCountDiff Map. empty
148
+ -- Q: why we don't return `toMempoolTxs'` in this case?
148
149
, ps
149
150
)
150
151
where
@@ -241,6 +242,7 @@ tickTimedTxs now st@SharedTxState{ timedTxs
241
242
, bufferedTxs } =
242
243
let (expiredTxs, timedTxs') = Map. split now timedTxs
243
244
expiredTxs' = -- Map.split doesn't include the `now` entry in any map
245
+ -- TODO: there must be a better way.
244
246
case Map. lookup now timedTxs of
245
247
Just txids -> Map. insert now txids expiredTxs
246
248
Nothing -> expiredTxs
You can’t perform that action at this time.
0 commit comments