lnsocket

A minimal C library for connecting to the lightning network
git clone git://jb55.com/lnsocket
Log | Files | Refs | Submodules | README | LICENSE

commit 9283615ac27459d18e1dccfd5d1391714bf02fce
parent a4278ab4c97808e3817062cdd57e6f3ebbe258c3
Author: William Casarin <jb55@jb55.com>
Date:   Sat, 22 Jan 2022 18:33:08 -0800

macos: fix timeout

Signed-off-by: William Casarin <jb55@jb55.com>

Diffstat:
Mrpc.c | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/rpc.c b/rpc.c @@ -36,7 +36,8 @@ int main(int argc, const char *argv[]) timeout_str = getenv("LNRPC_TIMEOUT"); int timeout_ms = timeout_str ? atoi(timeout_str) : 5000; - timeout.tv_usec = 1000 * timeout_ms; + timeout.tv_sec = timeout_ms / 1000; + timeout.tv_usec = (timeout_ms % 1000) * 1000; FD_ZERO(&set); /* clear the set */