Browse Source

move lnaddr.py to lib

regtest_lnd
ThomasV 7 years ago
committed by SomberNight
parent
commit
9ec879e23b
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 2
      electrum/gui/qt/main_window.py
  2. 2
      electrum/gui/qt/request_list.py
  3. 2
      gui/kivy/uix/dialogs/lightning_payer.py
  4. 0
      lib/lnaddr.py
  5. 2
      lib/lnbase.py
  6. 2
      lib/lnworker.py

2
electrum/gui/qt/main_window.py

@ -1876,7 +1876,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
self.payment_request_error_signal.emit() self.payment_request_error_signal.emit()
def parse_lightning_invoice(self, invoice): def parse_lightning_invoice(self, invoice):
from electrum.lightning_payencode.lnaddr import lndecode from electrum.lnaddr import lndecode
lnaddr = lndecode(invoice, expected_hrp=constants.net.SEGWIT_HRP) lnaddr = lndecode(invoice, expected_hrp=constants.net.SEGWIT_HRP)
pubkey = bh2u(lnaddr.pubkey.serialize()) pubkey = bh2u(lnaddr.pubkey.serialize())
for k,v in lnaddr.tags: for k,v in lnaddr.tags:

2
electrum/gui/qt/request_list.py

@ -152,7 +152,7 @@ class RequestList(MyTreeView):
self.filter() self.filter()
# lightning # lightning
for payreq_key, r in self.wallet.lnworker.invoices.items(): for payreq_key, r in self.wallet.lnworker.invoices.items():
from electrum.lightning_payencode.lnaddr import lndecode from electrum.lnaddr import lndecode
import electrum.constants as constants import electrum.constants as constants
lnaddr = lndecode(r, expected_hrp=constants.net.SEGWIT_HRP) lnaddr = lndecode(r, expected_hrp=constants.net.SEGWIT_HRP)
amount_sat = lnaddr.amount*COIN if lnaddr.amount else None amount_sat = lnaddr.amount*COIN if lnaddr.amount else None

2
gui/kivy/uix/dialogs/lightning_payer.py

@ -3,7 +3,7 @@ from kivy.lang import Builder
from kivy.factory import Factory from kivy.factory import Factory
from electrum_gui.kivy.i18n import _ from electrum_gui.kivy.i18n import _
from kivy.clock import mainthread from kivy.clock import mainthread
from electrum.lightning_payencode.lnaddr import lndecode from electrum.lnaddr import lndecode
Builder.load_string(''' Builder.load_string('''
<LightningPayerDialog@Popup> <LightningPayerDialog@Popup>

0
lib/lightning_payencode/lnaddr.py → lib/lnaddr.py

2
lib/lnbase.py

@ -32,7 +32,7 @@ from . import transaction
from .util import PrintError, bh2u, print_error, bfh, profiler, xor_bytes from .util import PrintError, bh2u, print_error, bfh, profiler, xor_bytes
from .transaction import opcodes, Transaction from .transaction import opcodes, Transaction
from .lnrouter import new_onion_packet, OnionHopsDataSingle, OnionPerHop, decode_onion_error from .lnrouter import new_onion_packet, OnionHopsDataSingle, OnionPerHop, decode_onion_error
from .lightning_payencode.lnaddr import lndecode from .lnaddr import lndecode
from .lnhtlc import UpdateAddHtlc, HTLCStateMachine, RevokeAndAck, SettleHtlc from .lnhtlc import UpdateAddHtlc, HTLCStateMachine, RevokeAndAck, SettleHtlc
REV_GENESIS = bytes.fromhex(bitcoin.rev_hex(constants.net.GENESIS)) REV_GENESIS = bytes.fromhex(bitcoin.rev_hex(constants.net.GENESIS))

2
lib/lnworker.py

@ -11,7 +11,7 @@ from .bitcoin import sha256, COIN
from .util import bh2u, bfh, PrintError from .util import bh2u, bfh, PrintError
from .constants import set_testnet, set_simnet from .constants import set_testnet, set_simnet
from .lnbase import Peer, privkey_to_pubkey from .lnbase import Peer, privkey_to_pubkey
from .lightning_payencode.lnaddr import lnencode, LnAddr, lndecode from .lnaddr import lnencode, LnAddr, lndecode
from .ecc import der_sig_from_sig_string from .ecc import der_sig_from_sig_string
from .transaction import Transaction from .transaction import Transaction
from .lnhtlc import HTLCStateMachine from .lnhtlc import HTLCStateMachine

Loading…
Cancel
Save