Browse Source

channeld: Make sure status_setup_sync is called before status_failed

This was still happening if reading the `channel_init` message failed.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
ppa-0.6.1
Christian Decker 8 years ago
committed by Rusty Russell
parent
commit
006d664b59
  1. 4
      channeld/channel.c

4
channeld/channel.c

@ -1995,6 +1995,8 @@ static void init_channel(struct peer *peer)
assert(!(fcntl(MASTER_FD, F_GETFL) & O_NONBLOCK));
status_setup_sync(MASTER_FD);
msg = wire_sync_read(peer, MASTER_FD);
if (!fromwire_channel_init(peer, msg, NULL,
&peer->chain_hash,
@ -2042,8 +2044,6 @@ static void init_channel(struct peer *peer)
status_failed(WIRE_CHANNEL_BAD_COMMAND, "Init: %s",
tal_hex(msg, msg));
status_setup_sync(MASTER_FD);
status_trace("init %s: remote_per_commit = %s, old_remote_per_commit = %s"
" next_idx_local = %"PRIu64
" next_idx_remote = %"PRIu64

Loading…
Cancel
Save