mirror of
https://github.com/RoboSats/robosats.git
synced 2024-12-13 19:06:26 +00:00
Add retry time and lnpayment properties for routing failure
This commit is contained in:
parent
8919b7937b
commit
be5b32c451
@ -21,6 +21,8 @@ FEE = 0.002
|
||||
BOND_SIZE = 0.01
|
||||
# Time out penalty for canceling takers in SECONDS
|
||||
PENALTY_TIMEOUT = 60
|
||||
# Time between routing attempts of buyer invoice in MINUTES
|
||||
RETRY_TIME = 5
|
||||
|
||||
# Trade limits in satoshis
|
||||
MIN_TRADE = 10000
|
||||
|
@ -26,6 +26,7 @@ from decouple import config
|
||||
|
||||
EXP_MAKER_BOND_INVOICE = int(config('EXP_MAKER_BOND_INVOICE'))
|
||||
FEE = float(config('FEE'))
|
||||
RETRY_TIME = int(config('RETRY_TIME'))
|
||||
|
||||
avatar_path = Path('frontend/static/assets/avatars')
|
||||
avatar_path.mkdir(parents=True, exist_ok=True)
|
||||
@ -230,6 +231,11 @@ class OrderView(viewsets.ViewSet):
|
||||
data['statement_submitted'] = (order.maker_statement != None and order.maker_statement != "")
|
||||
elif data['is_taker']:
|
||||
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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user