Skip to content

Commit

Permalink
make pre-insert check stop going through Pact if not necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
edmundnoble committed Aug 26, 2024
1 parent 14ca523 commit 723951f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Chainweb/Chainweb.hs
Original file line number Diff line number Diff line change
Expand Up @@ -319,10 +319,12 @@ validatingMempoolConfig cid v gl gp mv = Mempool.InMemConfig
:: V.Vector (T2 Mempool.TransactionHash ChainwebTransaction)
-> IO (V.Vector (Either (T2 Mempool.TransactionHash Mempool.InsertError)
(T2 Mempool.TransactionHash ChainwebTransaction)))
preInsertBatch txs = do
pex <- readMVar mv
rs <- _pactPreInsertCheck pex cid (V.map ssnd txs)
pure $ alignWithV f rs txs
preInsertBatch txs
| V.null txs = return V.empty
| otherwise = do
pex <- readMVar mv
rs <- _pactPreInsertCheck pex cid (V.map ssnd txs)
pure $ alignWithV f rs txs
where
f (These r (T2 h t)) = case r of
Left e -> Left (T2 h e)
Expand Down

0 comments on commit 723951f

Please sign in to comment.