Safe order flow from contract additions to profile

This commit is contained in:
Reckless_Satoshi 2022-03-05 04:21:01 -08:00
parent 533809749c
commit 06b86796ca
No known key found for this signature in database
GPG Key ID: 9C4585B561315571

View File

@ -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)