mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
devtools/gossipwith: change timeout to seconds.
I always get this wrong, then wonder why it's dying! Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
709c98f539
commit
3437f7e25d
@ -877,7 +877,7 @@ class LightningNode(object):
|
|||||||
timeout=TIMEOUT,
|
timeout=TIMEOUT,
|
||||||
stdout=subprocess.PIPE).stdout.strip()
|
stdout=subprocess.PIPE).stdout.strip()
|
||||||
out = subprocess.run(['devtools/gossipwith',
|
out = subprocess.run(['devtools/gossipwith',
|
||||||
'--timeout-after={}'.format(int(math.sqrt(TIMEOUT) * 1000)),
|
'--timeout-after={}'.format(int(math.sqrt(TIMEOUT) + 1)),
|
||||||
'{}@localhost:{}'.format(self.info['id'],
|
'{}@localhost:{}'.format(self.info['id'],
|
||||||
self.port),
|
self.port),
|
||||||
query],
|
query],
|
||||||
|
@ -164,7 +164,8 @@ static struct io_plan *handshake_success(struct io_conn *conn,
|
|||||||
beint16_t belen;
|
beint16_t belen;
|
||||||
u8 *msg;
|
u8 *msg;
|
||||||
|
|
||||||
if (poll(pollfd, ARRAY_SIZE(pollfd), timeout_after) == 0)
|
if (poll(pollfd, ARRAY_SIZE(pollfd),
|
||||||
|
timeout_after < 0 ? -1 : timeout_after * 1000) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* We always to stdin first if we can */
|
/* We always to stdin first if we can */
|
||||||
@ -235,7 +236,7 @@ int main(int argc, char *argv[])
|
|||||||
"Secret key to use for our identity");
|
"Secret key to use for our identity");
|
||||||
opt_register_arg("--timeout-after", opt_set_intval, opt_show_intval,
|
opt_register_arg("--timeout-after", opt_set_intval, opt_show_intval,
|
||||||
&timeout_after,
|
&timeout_after,
|
||||||
"Exit (success) this many msec after no msgs rcvd");
|
"Exit (success) this many seconds after no msgs rcvd");
|
||||||
opt_register_noarg("--help|-h", opt_usage_and_exit,
|
opt_register_noarg("--help|-h", opt_usage_and_exit,
|
||||||
"id@addr[:port] [hex-msg-tosend...]\n"
|
"id@addr[:port] [hex-msg-tosend...]\n"
|
||||||
"Connect to a lightning peer and relay gossip messages from it",
|
"Connect to a lightning peer and relay gossip messages from it",
|
||||||
|
@ -1066,7 +1066,7 @@ def test_gossipwith(node_factory):
|
|||||||
|
|
||||||
out = subprocess.run(['devtools/gossipwith',
|
out = subprocess.run(['devtools/gossipwith',
|
||||||
'--initial-sync',
|
'--initial-sync',
|
||||||
'--timeout-after={}'.format(int(math.sqrt(TIMEOUT) * 1000)),
|
'--timeout-after={}'.format(int(math.sqrt(TIMEOUT) + 1)),
|
||||||
'{}@localhost:{}'.format(l1.info['id'], l1.port)],
|
'{}@localhost:{}'.format(l1.info['id'], l1.port)],
|
||||||
check=True,
|
check=True,
|
||||||
timeout=TIMEOUT, stdout=subprocess.PIPE).stdout
|
timeout=TIMEOUT, stdout=subprocess.PIPE).stdout
|
||||||
|
Loading…
Reference in New Issue
Block a user