This repository was archived by the owner on Aug 18, 2020. It is now read-only.
File tree 1 file changed +6
-7
lines changed
wallet-new/src/Cardano/Wallet/Kernel/DB
1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -498,17 +498,16 @@ putTxMetaT conn txMeta =
498
498
-- This is the only acceptable exception here. If anything else is thrown, that`s an error.
499
499
t <- getTxMetasById conn txId
500
500
case (Kernel. txIdIsomorphic txMeta <$> t) of
501
- Nothing ->
502
- -- Output is there but not TxMeta. This should never happen.
503
- -- This could be improved with foreign keys, which indicate
504
- -- the existence of at least one Meta entry for each Output.
505
- throwIO $ Kernel. InvariantViolated (Kernel. UndisputableLookupFailed " txId" )
506
501
Just False ->
507
502
-- This violation means the Tx has same TxId but different
508
503
-- Inputs (as set) or Outputs (ordered).
509
504
throwIO $ Kernel. InvariantViolated (Kernel. TxIdInvariantViolated txId)
510
- Just True -> do
511
- -- If there not a TxId violation, we can try to insert TxMeta.
505
+ _ -> do
506
+ -- If there is not a TxId violation, we can try to insert TxMeta.
507
+ -- We handle Nothing and (Just True) the same here, since
508
+ -- it's possible that there is no Meta with this Inputs/Outputs.
509
+ -- In the future we may consider doing a better cleanup to avoid
510
+ -- such cases.
512
511
res2 <- Sqlite. runDBAction $ runBeamSqlite conn $
513
512
SQL. runInsert $ SQL. insert (_mDbMeta metaDB) $ SQL. insertValues [tMeta]
514
513
case res2 of
You can’t perform that action at this time.
0 commit comments