mirror of
https://github.com/RoboSats/robosats.git
synced 2025-01-31 02:21:35 +00:00
Add check if attribute order exists when triggering an order status
This commit is contained in:
parent
7a6c29fe64
commit
285f85aaf2
@ -520,7 +520,6 @@ class Logics():
|
||||
|
||||
# Do not gen if a taker invoice exist. Do not return if it is already locked. Return the old one if still waiting.
|
||||
if order.taker_bond:
|
||||
# Check if status is INVGEN and still not expired
|
||||
if cls.is_taker_bond_locked(order):
|
||||
return False, None
|
||||
elif order.taker_bond.status == LNPayment.Status.INVGEN:
|
||||
|
@ -105,21 +105,20 @@ class Command(BaseCommand):
|
||||
|
||||
# If the LNPayment goes to LOCKED (ACCEPTED)
|
||||
if lnpayment.status == LNPayment.Status.LOCKED:
|
||||
|
||||
try:
|
||||
# It is a maker bond => Publish order.
|
||||
if not lnpayment.order_made == None:
|
||||
if hasattr(lnpayment, 'order_made' ):
|
||||
Logics.publish_order(lnpayment.order_made)
|
||||
return
|
||||
|
||||
# It is a taker bond => close contract.
|
||||
elif not lnpayment.order_taken == None:
|
||||
elif hasattr(lnpayment, 'order_taken' ):
|
||||
if lnpayment.order_taken.status == Order.Status.TAK:
|
||||
Logics.finalize_contract(lnpayment.order_taken)
|
||||
return
|
||||
|
||||
# It is a trade escrow => move foward order status.
|
||||
elif not lnpayment.order_escrow == None:
|
||||
elif hasattr(lnpayment, 'order_escrow' ):
|
||||
Logics.trade_escrow_received(lnpayment.order_escrow)
|
||||
return
|
||||
except Exception as e:
|
||||
|
Loading…
Reference in New Issue
Block a user