Browse Source

lightningd: fix bogus channel iteration on setchannelfee

Setting channel to NULL then iterating doesn't work!

Fixes: #2733
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
pull/2938/head
Rusty Russell 6 years ago
parent
commit
67eb26c5e6
  1. 2
      lightningd/peer_control.c

2
lightningd/peer_control.c

@ -1537,7 +1537,6 @@ static struct command_result *json_setchannelfee(struct command *cmd,
/* If the users requested 'all' channels we need to iterate */ /* If the users requested 'all' channels we need to iterate */
if (channel == NULL) { if (channel == NULL) {
list_for_each(&cmd->ld->peers, peer, list) { list_for_each(&cmd->ld->peers, peer, list) {
list_for_each(&peer->channels, channel, list) {
channel = peer_active_channel(peer); channel = peer_active_channel(peer);
if (!channel) if (!channel)
continue; continue;
@ -1546,7 +1545,6 @@ static struct command_result *json_setchannelfee(struct command *cmd,
continue; continue;
set_channel_fees(cmd, channel, *base, *ppm, response); set_channel_fees(cmd, channel, *base, *ppm, response);
} }
}
/* single channel should be updated */ /* single channel should be updated */
} else { } else {

Loading…
Cancel
Save