mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
lightningd: deprecate weird listening options.
These are only likely to confuse users, by silently changing behavior. Changelog-Deprecated: Config: bind-addr=xxx.onion and addr=xxx.onion, use announce=xxx.onion (which was always equivalent). Changelog-Deprecated: Config: addr=/socketpath, use listen=/socketpath (which was always equivalent).
This commit is contained in:
@@ -277,9 +277,12 @@ static char *opt_add_addr_withtype(const char *arg,
|
||||
/* Can't happen any more */
|
||||
abort();
|
||||
case ADDR_TYPE_TOR_V3:
|
||||
/* I'm not sure why we allow this abuse, but we fix it up. */
|
||||
switch (ala) {
|
||||
case ADDR_LISTEN:
|
||||
if (!deprecated_apis)
|
||||
return tal_fmt(NULL,
|
||||
"Don't use --bind-addr=%s, use --announce-addr=%s",
|
||||
arg, arg);
|
||||
log_unusual(ld->log,
|
||||
"You used `--bind-addr=%s` option with an .onion address,"
|
||||
" You are lucky in this node live some wizards and"
|
||||
@@ -288,6 +291,10 @@ static char *opt_add_addr_withtype(const char *arg,
|
||||
/* And we ignore it */
|
||||
return NULL;
|
||||
case ADDR_LISTEN_AND_ANNOUNCE:
|
||||
if (!deprecated_apis)
|
||||
return tal_fmt(NULL,
|
||||
"Don't use --addr=%s, use --announce-addr=%s",
|
||||
arg, arg);
|
||||
log_unusual(ld->log,
|
||||
"You used `--addr=%s` option with an .onion address,"
|
||||
" You are lucky in this node live some wizards and"
|
||||
@@ -324,12 +331,14 @@ static char *opt_add_addr_withtype(const char *arg,
|
||||
}
|
||||
break;
|
||||
case ADDR_INTERNAL_SOCKNAME:
|
||||
/* We turn --addr into --bind-addr */
|
||||
switch (ala) {
|
||||
case ADDR_ANNOUNCE:
|
||||
return tal_fmt(NULL,
|
||||
"Cannot announce sockets, try --bind-addr=%s", arg);
|
||||
case ADDR_LISTEN_AND_ANNOUNCE:
|
||||
if (!deprecated_apis)
|
||||
return tal_fmt(NULL, "Don't use --addr=%s, use --bind-addr=%s",
|
||||
arg, arg);
|
||||
ala = ADDR_LISTEN;
|
||||
/* Fall thru */
|
||||
case ADDR_LISTEN:
|
||||
|
||||
@@ -721,16 +721,6 @@ def test_address(node_factory):
|
||||
ret = l2.rpc.connect(l1.info['id'], l1.daemon.opts['bind-addr'])
|
||||
assert ret['address'] == {'type': 'local socket', 'socket': l1.daemon.opts['bind-addr']}
|
||||
|
||||
# 'addr' with local socket works too.
|
||||
l1.stop()
|
||||
del l1.daemon.opts['bind-addr']
|
||||
l1.daemon.opts['addr'] = os.path.join(l1.daemon.lightning_dir, TEST_NETWORK, "sock")
|
||||
# start expects a port, so we open-code here.
|
||||
l1.daemon.start()
|
||||
|
||||
l2 = node_factory.get_node()
|
||||
l2.rpc.connect(l1.info['id'], l1.daemon.opts['addr'])
|
||||
|
||||
|
||||
def test_listconfigs(node_factory, bitcoind, chainparams):
|
||||
# Make extremely long entry, check it works
|
||||
|
||||
Reference in New Issue
Block a user