Browse Source

add 'recḱless' option to allow using lightning on mainnet

dependabot/pip/contrib/deterministic-build/ecdsa-0.13.3
ThomasV 6 years ago
parent
commit
626d09b358
  1. 1
      electrum/commands.py
  2. 10
      electrum/lnworker.py
  3. 2
      run_electrum

1
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("--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("--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("--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(): def get_parser():
# create main parser # create main parser

10
electrum/lnworker.py

@ -34,9 +34,13 @@ NUM_PEERS_TARGET = 4
PEER_RETRY_INTERVAL = 600 # seconds PEER_RETRY_INTERVAL = 600 # seconds
PEER_RETRY_INTERVAL_FOR_CHANNELS = 30 # seconds PEER_RETRY_INTERVAL_FOR_CHANNELS = 30 # seconds
FALLBACK_NODE_LIST = ( FALLBACK_NODE_LIST_TESTNET = (
LNPeerAddr('ecdsa.net', 9735, bfh('038370f0e7a03eded3e1d41dc081084a87f0afa1c5b22090b4f3abb391eb15d8ff')), 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): 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 # 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: # and only return mainnet nodes. so for the time being dns seeding is disabled:
if constants.net in (constants.BitcoinTestnet, ): 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: else:
return [] return []

2
run_electrum

@ -352,7 +352,7 @@ if __name__ == '__main__':
constants.set_regtest() constants.set_regtest()
elif config.get('simnet'): elif config.get('simnet'):
constants.set_simnet() constants.set_simnet()
else: elif not config.get('reckless'):
raise Exception('lightning branch not available on mainnet') raise Exception('lightning branch not available on mainnet')
if cmdname == 'gui': if cmdname == 'gui':

Loading…
Cancel
Save