@@ -240,7 +240,6 @@ insertByronTx ::
240240 Word64 ->
241241 ExceptT SyncNodeError (ReaderT SqlBackend m ) Word64
242242insertByronTx syncEnv blkId tx blockIndex = do
243- let txId = DB. TxKey $ DB. unBlockKey blkId
244243 disInOut <- liftIO $ getDisableInOutState syncEnv
245244 if disInOut
246245 then do
@@ -273,19 +272,20 @@ insertByronTx syncEnv blkId tx blockIndex = do
273272 }
274273
275274 pure 0
276- else insertByronTx' syncEnv blkId tx blockIndex
275+ else insertByronTx' syncEnv blkId txId tx blockIndex
277276 where
278277 iopts = getInsertOptions syncEnv
278+ txId = DB. TxKey $ DB. unBlockKey blkId + fromIntegral blockIndex
279279
280280insertByronTx' ::
281281 (MonadBaseControl IO m , MonadIO m ) =>
282282 SyncEnv ->
283283 DB. BlockId ->
284+ DB. TxId ->
284285 Byron. TxAux ->
285286 Word64 ->
286287 ExceptT SyncNodeError (ReaderT SqlBackend m ) Word64
287- insertByronTx' syncEnv blkId tx blockIndex = do
288- let txId = DB. TxKey $ fromIntegral $ fromIntegral (DB. unBlockId blkId) * 1000 + blockIndex
288+ insertByronTx' syncEnv blkId txId tx blockIndex = do
289289 resolvedInputs <- mapM (resolveTxInputs txOutTableType) (toList $ Byron. txInputs (Byron. taTx tx))
290290 valFee <- firstExceptT annotateTx $ ExceptT $ pure (calculateTxFee (Byron. taTx tx) resolvedInputs)
291291 lift $
@@ -324,7 +324,7 @@ insertByronTx' syncEnv blkId tx blockIndex = do
324324 mapM_ (insertTxIn tracer txId) resolvedInputs
325325 whenConsumeOrPruneTxOut syncEnv $
326326 lift $
327- DB. updateListTxOutConsumedByTxId (prepUpdate txId <$> resolvedInputs)
327+ DB. updateListTxOutConsumedByTxId (prepUpdate <$> resolvedInputs)
328328 -- fees are being returned so we can sum them and put them in cache to use when updating epochs
329329 pure $ unDbLovelace $ vfFee valFee
330330 where
@@ -340,7 +340,7 @@ insertByronTx' syncEnv blkId tx blockIndex = do
340340 SNErrInvariant loc ei -> SNErrInvariant loc (annotateInvariantTx (Byron. taTx tx) ei)
341341 _other -> ee
342342
343- prepUpdate txId (_, _, txOutId, _) = (txOutId, txId)
343+ prepUpdate (_, _, txOutId, _) = (txOutId, txId)
344344
345345insertTxOutByron ::
346346 (MonadBaseControl IO m , MonadIO m ) =>
0 commit comments