Add support for mercy transactions for refund-refund path

This commit is contained in:
mainnet-pat
2024-11-05 18:41:07 +00:00
committed by tecnovert
parent 62e6978be1
commit a214866b08
2 changed files with 46 additions and 2 deletions

View File

@@ -3871,6 +3871,14 @@ class BasicSwap(BaseApp):
)
self.saveBidInSession(bid_id, bid, session, xmr_swap)
session.commit()
if self.isBchXmrSwap(offer):
for_ed25519: bool = True if ci_to.curve_type() == Curves.ed25519 else False
kbsf = self.getPathKey(offer.coin_from, offer.coin_to, bid.created_at, xmr_swap.contract_count, KeyTypes.KBSF, for_ed25519)
mercy_tx = ci_from.createMercyTx(xmr_swap.a_lock_refund_swipe_tx, h2b(txid), xmr_swap.a_lock_refund_tx_script, kbsf)
txid = ci_from.publishTx(mercy_tx)
self.log.info('Submitted mercy tx for bid %s, txid %s', bid_id.hex(), txid)
except Exception as ex:
self.log.debug('Trying to publish coin a lock refund swipe tx: %s', str(ex))