mirror of
https://github.com/RoboSats/robosats.git
synced 2025-01-18 20:21:35 +00:00
Small fixes
This commit is contained in:
parent
1a6aa8a9ee
commit
db2d7cc922
@ -122,22 +122,11 @@ class LNNode():
|
|||||||
lnpayment.save()
|
lnpayment.save()
|
||||||
return True
|
return True
|
||||||
|
|
||||||
# @classmethod
|
@classmethod
|
||||||
# def check_until_invoice_locked(cls, payment_hash, expiration):
|
def resetmc(cls):
|
||||||
# '''Checks until hold invoice is locked.
|
request = routerrpc.ResetMissionControlRequest()
|
||||||
# When invoice is locked, returns true.
|
response = cls.routerstub.ResetMissionControl(request, metadata=[('macaroon', MACAROON.hex())])
|
||||||
# If time expires, return False.'''
|
return True
|
||||||
# # Experimental, might need asyncio. Best if subscribing all invoices and running a background task
|
|
||||||
# # Maybe best to pass LNpayment object and change status live.
|
|
||||||
|
|
||||||
# request = invoicesrpc.SubscribeSingleInvoiceRequest(r_hash=payment_hash)
|
|
||||||
# for invoice in cls.invoicesstub.SubscribeSingleInvoice(request):
|
|
||||||
# print(invoice)
|
|
||||||
# if timezone.now > expiration:
|
|
||||||
# break
|
|
||||||
# if invoice.state == 3: # True if hold invoice is accepted.
|
|
||||||
# return True
|
|
||||||
# return False
|
|
||||||
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
@ -129,7 +129,7 @@ class Command(BaseCommand):
|
|||||||
|
|
||||||
queryset_retries = LNPayment.objects.filter(type=LNPayment.Types.NORM,
|
queryset_retries = LNPayment.objects.filter(type=LNPayment.Types.NORM,
|
||||||
status__in=[LNPayment.Status.VALIDI, LNPayment.Status.FAILRO],
|
status__in=[LNPayment.Status.VALIDI, LNPayment.Status.FAILRO],
|
||||||
routing_attempts__lt=4,
|
routing_attempts__lt=5,
|
||||||
last_routing_time__lt=(timezone.now()-timedelta(minutes=int(config('RETRY_TIME')))))
|
last_routing_time__lt=(timezone.now()-timedelta(minutes=int(config('RETRY_TIME')))))
|
||||||
|
|
||||||
queryset = queryset.union(queryset_retries)
|
queryset = queryset.union(queryset_retries)
|
||||||
@ -142,7 +142,7 @@ class Command(BaseCommand):
|
|||||||
LNNode.resetmc()
|
LNNode.resetmc()
|
||||||
|
|
||||||
# If already 3 attempts and last failed. Make it expire (ask for a new invoice) an reset attempts.
|
# If already 3 attempts and last failed. Make it expire (ask for a new invoice) an reset attempts.
|
||||||
if not success and lnpayment.routing_attempts == 3:
|
if not success and lnpayment.routing_attempts > 2:
|
||||||
lnpayment.status = LNPayment.Status.EXPIRE
|
lnpayment.status = LNPayment.Status.EXPIRE
|
||||||
lnpayment.routing_attempts = 0
|
lnpayment.routing_attempts = 0
|
||||||
lnpayment.save()
|
lnpayment.save()
|
||||||
|
@ -775,7 +775,7 @@ handleRatingRobosatsChange=(e)=>{
|
|||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={12} align="center">
|
<Grid item xs={12} align="center">
|
||||||
<Typography component="body2" variant="body2" align="center">
|
<Typography component="body2" variant="body2" align="center">
|
||||||
Your invoice has expires or more than 3 payments have been attempted.
|
Your invoice has expires or more than 3 payments attempts have been made.
|
||||||
</Typography>
|
</Typography>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={12} align="center">
|
<Grid item xs={12} align="center">
|
||||||
|
Loading…
Reference in New Issue
Block a user