Browse Source

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>
ppa-0.6.1
Rusty Russell 7 years ago
parent
commit
5acbc04ec8
  1. 3
      channeld/channel.c

3
channeld/channel.c

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

Loading…
Cancel
Save