Fix clean onchain_payment, also deletes 'created' objects. Fix rewards timeout

This commit is contained in:
Reckless_Satoshi 2022-07-10 04:04:27 -07:00
parent 4dff7efbb7
commit b76b333413
No known key found for this signature in database
GPG Key ID: 9C4585B561315571
2 changed files with 3 additions and 3 deletions

View File

@ -100,7 +100,7 @@ PROPORTIONAL_ROUTING_FEE_LIMIT = 0.001
MIN_FLAT_ROUTING_FEE_LIMIT = 10
MIN_FLAT_ROUTING_FEE_LIMIT_REWARD = 2
# Routing timeouts
REWARDS_TIMEOUT_SECONDS = 60
REWARDS_TIMEOUT_SECONDS = 30
PAYOUT_TIMEOUT_SECONDS = 90
# REVERSE SUBMARINE SWAP PAYOUTS

View File

@ -172,7 +172,7 @@ def payments_cleansing():
"""
Deletes cancelled payments (hodl invoices never locked) that
belong to orders expired more than 3 days ago.
Deletes cancelled onchain_payments
Deletes 'cancelled' or 'create' onchain_payments
"""
from django.db.models import Q
@ -202,7 +202,7 @@ def payments_cleansing():
pass
# same for onchain payments
queryset = OnchainPayment.objects.filter(Q(status=OnchainPayment.Status.CANCE),
queryset = OnchainPayment.objects.filter(Q(status__in=[OnchainPayment.Status.CANCE, OnchainPayment.Status.CREAT]),
Q(order_paid_TX__expires_at__lt=finished_time))
# And do not have an active trade, any past contract or any reward.