From 23eabffecabaf3d0c8d14ae74435fc0f58b58613 Mon Sep 17 00:00:00 2001 From: Reckless_Satoshi Date: Sun, 20 Feb 2022 03:39:28 -0800 Subject: [PATCH] Settle bonds at dispute opening. Avoids channel force closure in long resolution disputes. --- api/logics.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/api/logics.py b/api/logics.py index 8553b4fd..4be9217e 100644 --- a/api/logics.py +++ b/api/logics.py @@ -299,11 +299,15 @@ class Logics: @classmethod def open_dispute(cls, order, user=None): - # Always settle the escrow during a dispute - # Dispute winner will have to submit a new invoice. + # Always settle escro and bonds during a dispute. Disputes + # can take long to resolve, it might trigger force closure + # for unresolve HTLCs) Dispute winner will have to submit a + # new invoice for value of escrow + bond. if not order.trade_escrow.status == LNPayment.Status.SETLED: cls.settle_escrow(order) + cls.settle_bond(order.maker_bond) + cls.settle_bond(order.taker_bond) order.is_disputed = True order.status = Order.Status.DIS