URI: 
       tlightning: add --simnet and --lightning switches - electrum - Electrum Bitcoin wallet
  HTML git clone https://git.parazyd.org/electrum
   DIR Log
   DIR Files
   DIR Refs
   DIR Submodules
       ---
   DIR commit 0abfcd2b6a40ba206412f48ad50513a36be398e2
   DIR parent ae7bce338504aea4e76bec116cdc9664261954f0
  HTML Author: Janus <ysangkok@gmail.com>
       Date:   Thu,  5 Apr 2018 17:05:39 +0200
       
       lightning: add --simnet and --lightning switches
       
       Diffstat:
         M electrum/constants.py               |      26 +++++++++++++++++++++++++-
         M electrum/gui/qt/main_window.py      |       8 +++-----
         M lib/lightning.py                    |       4 ++--
       
       3 files changed, 30 insertions(+), 8 deletions(-)
       ---
   DIR diff --git a/electrum/constants.py b/electrum/constants.py
       t@@ -111,6 +111,31 @@ class BitcoinTestnet(AbstractNet):
            XPUB_HEADERS_INV = inv_dict(XPUB_HEADERS)
            BIP44_COIN_TYPE = 1
        
       +class BitcoinSimnet:
       +    ADDRTYPE_P2PKH = 0x3f
       +    ADDRTYPE_P2SH = 0x7b
       +    SEGWIT_HRP = "sb"
       +    GENESIS = "683e86bd5c6d110d91b94b97137ba6bfe02dbbdb8e3dff722a669b5d69d77af6"
       +    WIF_PREFIX = 0x00
       +    TESTNET = True
       +    DEFAULT_PORTS = {}
       +    DEFAULT_SERVERS = {}
       +    CHECKPOINTS = []
       +
       +    XPRV_HEADERS = {
       +        'standard':    0x04358394,  # tprv
       +        'p2wpkh-p2sh': 0x044a4e28,  # uprv
       +        'p2wsh-p2sh':  0x024285b5,  # Uprv
       +        'p2wpkh':      0x045f18bc,  # vprv
       +        'p2wsh':       0x02575048,  # Vprv
       +    }
       +    XPUB_HEADERS = {
       +        'standard':    0x043587cf,  # tpub
       +        'p2wpkh-p2sh': 0x044a5262,  # upub
       +        'p2wsh-p2sh':  0x024285ef,  # Upub
       +        'p2wpkh':      0x045f1cf6,  # vpub
       +        'p2wsh':       0x02575483,  # Vpub
       +    }
        
        class BitcoinRegtest(BitcoinTestnet):
        
       t@@ -139,7 +164,6 @@ def set_mainnet():
            global net
            net = BitcoinMainnet
        
       -
        def set_testnet():
            global net
            net = BitcoinTestnet
   DIR diff --git a/electrum/gui/qt/main_window.py b/electrum/gui/qt/main_window.py
       t@@ -172,11 +172,9 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
                self.utxo_tab = self.create_utxo_tab()
                self.console_tab = self.create_console_tab()
                self.contacts_tab = self.create_contacts_tab()
       -        tabs.addTab(self.create_history_tab(), read_QIcon("tab_history.png"), _('History'))
       -        tabs.addTab(self.send_tab, read_QIcon("tab_send.png"), _('Send'))
       -        tabs.addTab(self.receive_tab, read_QIcon("tab_receive.png"), _('Receive'))
       -        self.lightning_invoices_tab = self.create_lightning_invoices_tab(wallet)
       -        tabs.addTab(self.lightning_invoices_tab, _("Lightning Invoices"))
       +        if config.get("lightning", False):
       +            self.lightning_invoices_tab = self.create_lightning_invoices_tab(wallet)
       +            tabs.addTab(self.lightning_invoices_tab, _("Lightning Invoices"))
        
                def add_optional_tab(tabs, tab, icon, description, name):
                    tab.tab_icon = icon
   DIR diff --git a/lib/lightning.py b/lib/lightning.py
       t@@ -32,8 +32,8 @@ NETWORK = None
        CONFIG = None
        locked = set()
        
       -machine = "148.251.87.112"
       -#machine = "127.0.0.1"
       +#machine = "148.251.87.112"
       +machine = "127.0.0.1"
        
        def WriteDb(json):
            req = rpc_pb2.WriteDbRequest()