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:
Rusty Russell
2017-09-08 19:53:57 +09:30
parent 6d1bcc2c32
commit 5acbc04ec8

View File

@@ -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,