mirror of
https://github.com/cryptosharks131/lndg.git
synced 2026-08-13 12:33:04 +02:00
fix query issue in reindexing logic
This commit is contained in:
parent
23d3d5c847
commit
706158336d
1 changed files with 3 additions and 3 deletions
6
jobs.py
6
jobs.py
|
|
@ -46,7 +46,7 @@ def update_payments(stub):
|
|||
))
|
||||
payments = resp.payments
|
||||
for p in payments:
|
||||
db_payment = Payments.objects.filter(payment_hash=p.payment_hash)
|
||||
db_payment = Payments.objects.get(payment_hash=p.payment_hash)
|
||||
db_payment.index = p.payment_index
|
||||
db_payment.save()
|
||||
if len(payments) < page_size:
|
||||
|
|
@ -110,7 +110,7 @@ def update_payments(stub):
|
|||
break
|
||||
|
||||
def update_payment(stub, payment, self_pubkey):
|
||||
db_payment = Payments.objects.filter(payment_hash=payment.payment_hash)[0]
|
||||
db_payment = Payments.objects.get(payment_hash=payment.payment_hash)
|
||||
db_payment.creation_date = datetime.fromtimestamp(payment.creation_date)
|
||||
db_payment.value = round(payment.value_msat/1000, 3)
|
||||
db_payment.fee = round(payment.fee_msat/1000, 3)
|
||||
|
|
@ -172,7 +172,7 @@ def update_invoices(stub):
|
|||
))
|
||||
invoices = resp.invoices
|
||||
for i in invoices:
|
||||
db_invoice = Invoices.objects.filter(r_hash=i.r_hash)
|
||||
db_invoice = Invoices.objects.get(r_hash=i.r_hash)
|
||||
db_invoice.index = i.add_index
|
||||
db_invoice.save()
|
||||
if len(invoices) < page_size:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue