mirror of
https://github.com/RoboSats/robosats.git
synced 2025-07-18 16:53:16 +00:00
Add retry time and lnpayment properties for routing failure
This commit is contained in:
@ -21,6 +21,8 @@ FEE = 0.002
|
|||||||
BOND_SIZE = 0.01
|
BOND_SIZE = 0.01
|
||||||
# Time out penalty for canceling takers in SECONDS
|
# Time out penalty for canceling takers in SECONDS
|
||||||
PENALTY_TIMEOUT = 60
|
PENALTY_TIMEOUT = 60
|
||||||
|
# Time between routing attempts of buyer invoice in MINUTES
|
||||||
|
RETRY_TIME = 5
|
||||||
|
|
||||||
# Trade limits in satoshis
|
# Trade limits in satoshis
|
||||||
MIN_TRADE = 10000
|
MIN_TRADE = 10000
|
||||||
|
@ -26,6 +26,7 @@ from decouple import config
|
|||||||
|
|
||||||
EXP_MAKER_BOND_INVOICE = int(config('EXP_MAKER_BOND_INVOICE'))
|
EXP_MAKER_BOND_INVOICE = int(config('EXP_MAKER_BOND_INVOICE'))
|
||||||
FEE = float(config('FEE'))
|
FEE = float(config('FEE'))
|
||||||
|
RETRY_TIME = int(config('RETRY_TIME'))
|
||||||
|
|
||||||
avatar_path = Path('frontend/static/assets/avatars')
|
avatar_path = Path('frontend/static/assets/avatars')
|
||||||
avatar_path.mkdir(parents=True, exist_ok=True)
|
avatar_path.mkdir(parents=True, exist_ok=True)
|
||||||
@ -231,6 +232,11 @@ class OrderView(viewsets.ViewSet):
|
|||||||
elif data['is_taker']:
|
elif data['is_taker']:
|
||||||
data['statement_submitted'] = (order.taker_statement != None and order.maker_statement != "")
|
data['statement_submitted'] = (order.taker_statement != None and order.maker_statement != "")
|
||||||
|
|
||||||
|
# 9) If status is 'Failed routing', reply with retry amounts, time of next retry and ask for invoice at third.
|
||||||
|
elif order.status == Order.Status.FAI:
|
||||||
|
data['retries'] = order.buyer_invoice.routing_attempts
|
||||||
|
data['next_retry_time'] = order.buyer_invoice.last_routing_time + timedelta(minutes=RETRY_TIME)
|
||||||
|
|
||||||
return Response(data, status.HTTP_200_OK)
|
return Response(data, status.HTTP_200_OK)
|
||||||
|
|
||||||
def take_update_confirm_dispute_cancel(self, request, format=None):
|
def take_update_confirm_dispute_cancel(self, request, format=None):
|
||||||
|
Reference in New Issue
Block a user