mirror of
https://github.com/RoboSats/robosats.git
synced 2025-02-07 05:49:04 +00:00
Settle bonds at dispute opening. Avoids channel force closure in long resolution disputes.
This commit is contained in:
parent
03bfc487ea
commit
23eabffeca
@ -299,11 +299,15 @@ class Logics:
|
|||||||
@classmethod
|
@classmethod
|
||||||
def open_dispute(cls, order, user=None):
|
def open_dispute(cls, order, user=None):
|
||||||
|
|
||||||
# Always settle the escrow during a dispute
|
# Always settle escro and bonds during a dispute. Disputes
|
||||||
# Dispute winner will have to submit a new invoice.
|
# 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:
|
if not order.trade_escrow.status == LNPayment.Status.SETLED:
|
||||||
cls.settle_escrow(order)
|
cls.settle_escrow(order)
|
||||||
|
cls.settle_bond(order.maker_bond)
|
||||||
|
cls.settle_bond(order.taker_bond)
|
||||||
|
|
||||||
order.is_disputed = True
|
order.is_disputed = True
|
||||||
order.status = Order.Status.DIS
|
order.status = Order.Status.DIS
|
||||||
|
Loading…
Reference in New Issue
Block a user