mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-05 14:14:23 +01:00
channeld: assert we're not somehow nonblocking in init_channel.
Christian reported seeing a zero-length packet come in; this seems the most likely possibility. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
#include <common/type_to_string.h>
|
||||
#include <common/version.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <gossipd/routing.h>
|
||||
#include <hsmd/gen_hsm_client_wire.h>
|
||||
#include <inttypes.h>
|
||||
@@ -2020,6 +2021,8 @@ static void init_channel(struct peer *peer)
|
||||
u8 *msg;
|
||||
u32 feerate_per_kw;
|
||||
|
||||
assert(!(fcntl(REQ_FD, F_GETFL) & O_NONBLOCK));
|
||||
|
||||
msg = wire_sync_read(peer, REQ_FD);
|
||||
if (!fromwire_channel_init(peer, msg, NULL,
|
||||
&peer->chain_hash,
|
||||
|
||||
Reference in New Issue
Block a user