1
0
Fork 0
mirror of https://github.com/bitcoin-s/bitcoin-s.git synced 2025-03-26 21:42:48 +01:00

Use upsert rather than create in dlcsign in case we have seen the inputs before ()

This commit is contained in:
Chris Stewart 2022-04-08 07:01:43 -05:00 committed by GitHub
parent 30a061e549
commit a2587677c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -914,8 +914,8 @@ abstract class DLCWallet
s"CET Signatures for tempContractId ${accept.tempContractId.hex} were valid, adding to database")
_ <- remoteTxDAO.upsertAll(acceptPrevTxs)
inputAction = dlcInputsDAO.createAllAction(acceptInputs)
sigsAction = dlcSigsDAO.createAllAction(sigsDbs)
inputAction = dlcInputsDAO.upsertAllAction(acceptInputs)
sigsAction = dlcSigsDAO.upsertAllAction(sigsDbs)
_ <- safeDatabase.run(DBIO.sequence(Vector(inputAction, sigsAction)))
_ <- dlcRefundSigDAO.upsert(refundSigsDb)
_ <- dlcAcceptDAO.upsert(dlcAcceptDb)