mirror of
https://github.com/RoboSats/robosats.git
synced 2025-02-07 13:59:06 +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.
|
# 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:
|
if order.taker_bond:
|
||||||
# Check if status is INVGEN and still not expired
|
|
||||||
if cls.is_taker_bond_locked(order):
|
if cls.is_taker_bond_locked(order):
|
||||||
return False, None
|
return False, None
|
||||||
elif order.taker_bond.status == LNPayment.Status.INVGEN:
|
elif order.taker_bond.status == LNPayment.Status.INVGEN:
|
||||||
|
@ -105,21 +105,20 @@ class Command(BaseCommand):
|
|||||||
|
|
||||||
# If the LNPayment goes to LOCKED (ACCEPTED)
|
# If the LNPayment goes to LOCKED (ACCEPTED)
|
||||||
if lnpayment.status == LNPayment.Status.LOCKED:
|
if lnpayment.status == LNPayment.Status.LOCKED:
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# It is a maker bond => Publish order.
|
# It is a maker bond => Publish order.
|
||||||
if not lnpayment.order_made == None:
|
if hasattr(lnpayment, 'order_made' ):
|
||||||
Logics.publish_order(lnpayment.order_made)
|
Logics.publish_order(lnpayment.order_made)
|
||||||
return
|
return
|
||||||
|
|
||||||
# It is a taker bond => close contract.
|
# 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:
|
if lnpayment.order_taken.status == Order.Status.TAK:
|
||||||
Logics.finalize_contract(lnpayment.order_taken)
|
Logics.finalize_contract(lnpayment.order_taken)
|
||||||
return
|
return
|
||||||
|
|
||||||
# It is a trade escrow => move foward order status.
|
# 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)
|
Logics.trade_escrow_received(lnpayment.order_escrow)
|
||||||
return
|
return
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
Loading…
Reference in New Issue
Block a user