From 06b86796cafdcaac3e6be06742e2b9a3f715db4e Mon Sep 17 00:00:00 2001 From: Reckless_Satoshi Date: Sat, 5 Mar 2022 04:21:01 -0800 Subject: [PATCH] Safe order flow from contract additions to profile --- api/logics.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/api/logics.py b/api/logics.py index 81760448..a7a368b3 100644 --- a/api/logics.py +++ b/api/logics.py @@ -737,17 +737,18 @@ class Logics: order.taker_bond.status = LNPayment.Status.LOCKED order.taker_bond.save() + # With the bond confirmation the order is extended 'public_order_duration' hours + order.expires_at = timezone.now() + timedelta( + seconds=Order.t_to_expire[Order.Status.WF2]) + order.status = Order.Status.WF2 + order.save() + # Both users profiles are added one more contract // Unsafe can add more than once. order.maker.profile.total_contracts += 1 order.taker.profile.total_contracts += 1 order.maker.profile.save() order.taker.profile.save() - - # With the bond confirmation the order is extended 'public_order_duration' hours - order.expires_at = timezone.now() + timedelta( - seconds=Order.t_to_expire[Order.Status.WF2]) - order.status = Order.Status.WF2 - order.save() + # Log a market tick try: MarketTick.log_a_tick(order)