Invert updating of DLC state and broadcasting the funding tx (#3526)

* Invert updating of DLC state and broadcasting the funding tx

* Move log message
This commit is contained in:
Chris Stewart 2021-08-11 15:06:28 -05:00 committed by GitHub
parent 037ab7341e
commit 1d6ede492f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1157,11 +1157,10 @@ abstract class DLCWallet
contractId: ByteVector): Future[Transaction] = {
for {
tx <- getDLCFundingTx(contractId)
_ <- updateDLCState(contractId, DLCState.Broadcasted)
_ = logger.info(
s"Broadcasting funding transaction ${tx.txIdBE.hex} for contract ${contractId.toHex}")
_ <- broadcastTransaction(tx)
_ <- updateDLCState(contractId, DLCState.Broadcasted)
} yield tx
}