From 626d09b35806a74d9a2a3c3cda04e6f404eb2971 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Sun, 14 Oct 2018 10:24:06 +0200 Subject: [PATCH] =?UTF-8?q?add=20'rec=E1=B8=B1less'=20option=20to=20allow?= =?UTF-8?q?=20using=20lightning=20on=20mainnet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- electrum/commands.py | 1 + electrum/lnworker.py | 10 ++++++++-- run_electrum | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/electrum/commands.py b/electrum/commands.py index ee68a4627..3173b22b9 100644 --- a/electrum/commands.py +++ b/electrum/commands.py @@ -980,6 +980,7 @@ def add_global_options(parser): group.add_argument("--testnet", action="store_true", dest="testnet", default=False, help="Use Testnet") group.add_argument("--regtest", action="store_true", dest="regtest", default=False, help="Use Regtest") group.add_argument("--simnet", action="store_true", dest="simnet", default=False, help="Use Simnet") + group.add_argument("--reckless", action="store_true", dest="reckless", default=False, help="Play with real money") def get_parser(): # create main parser diff --git a/electrum/lnworker.py b/electrum/lnworker.py index 22c767f0d..8155e8550 100644 --- a/electrum/lnworker.py +++ b/electrum/lnworker.py @@ -34,9 +34,13 @@ NUM_PEERS_TARGET = 4 PEER_RETRY_INTERVAL = 600 # seconds PEER_RETRY_INTERVAL_FOR_CHANNELS = 30 # seconds -FALLBACK_NODE_LIST = ( +FALLBACK_NODE_LIST_TESTNET = ( LNPeerAddr('ecdsa.net', 9735, bfh('038370f0e7a03eded3e1d41dc081084a87f0afa1c5b22090b4f3abb391eb15d8ff')), ) +FALLBACK_NODE_LIST_MAINNET = ( + LNPeerAddr('104.198.32.198', 9735, bfh('02f6725f9c1c40333b67faea92fd211c183050f28df32cac3f9d69685fe9665432')), # Blockstream + LNPeerAddr('13.80.67.162', 9735, bfh('02c0ac82c33971de096d87ce5ed9b022c2de678f08002dc37fdb1b6886d12234b5')), # Stampery +) class LNWorker(PrintError): @@ -398,7 +402,9 @@ class LNWorker(PrintError): # TODO remove this. For some reason the dns seeds seem to ignore the realm byte # and only return mainnet nodes. so for the time being dns seeding is disabled: if constants.net in (constants.BitcoinTestnet, ): - return [random.choice(FALLBACK_NODE_LIST)] + return [random.choice(FALLBACK_NODE_LIST_TESTNET)] + elif constants.net in (constants.BitcoinMainnet, ): + return [random.choice(FALLBACK_NODE_LIST_MAINNET)] else: return [] diff --git a/run_electrum b/run_electrum index bdfe723cb..49f95cde1 100755 --- a/run_electrum +++ b/run_electrum @@ -352,7 +352,7 @@ if __name__ == '__main__': constants.set_regtest() elif config.get('simnet'): constants.set_simnet() - else: + elif not config.get('reckless'): raise Exception('lightning branch not available on mainnet') if cmdname == 'gui':