mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 21:35:11 +01:00
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>
This commit is contained in:
parent
48b876e401
commit
006d664b59
@ -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…
Reference in New Issue
Block a user