daemon: fix case where commit has nothing to do.

Prevents assert() triggering in queue_pkt_commit().

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2016-06-29 06:49:20 +09:30
parent b820f5a0dd
commit 43db90391a

View File

@@ -637,7 +637,8 @@ static void do_commit(struct peer *peer, struct command *jsoncmd)
if (!peer_uncommitted_changes(peer)) {
log_debug(peer->log, "do_commit: no changes to commit");
if (jsoncmd)
command_fail(jsoncmd, "no changes to commit");
command_fail(jsoncmd, "no changes to commit");
return;
}
log_debug(peer->log, "do_commit: sending commit command");