mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-04 04:45:16 +00:00
kivy: lnpay_thread
This commit is contained in:
parent
9e78fdbf71
commit
f8038d024b
1 changed files with 6 additions and 0 deletions
|
@ -3,6 +3,7 @@ from weakref import ref
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
import re
|
import re
|
||||||
import datetime
|
import datetime
|
||||||
|
import threading
|
||||||
import traceback, sys
|
import traceback, sys
|
||||||
from enum import Enum, auto
|
from enum import Enum, auto
|
||||||
|
|
||||||
|
@ -299,6 +300,11 @@ class SendScreen(CScreen):
|
||||||
return
|
return
|
||||||
invoice = self.screen.address
|
invoice = self.screen.address
|
||||||
amount_sat = self.app.get_amount(self.screen.amount)
|
amount_sat = self.app.get_amount(self.screen.amount)
|
||||||
|
threading.Thread(target=self._lnpay_thread, args=(invoice, amount_sat)).start()
|
||||||
|
|
||||||
|
def _lnpay_thread(self, invoice, amount_sat):
|
||||||
|
self.do_clear()
|
||||||
|
self.app.show_info(_('Payment in progress..'))
|
||||||
try:
|
try:
|
||||||
success = self.app.wallet.lnworker.pay(invoice, attempts=10, amount_sat=amount_sat, timeout=60)
|
success = self.app.wallet.lnworker.pay(invoice, attempts=10, amount_sat=amount_sat, timeout=60)
|
||||||
except PaymentFailure as e:
|
except PaymentFailure as e:
|
||||||
|
|
Loading…
Add table
Reference in a new issue