From 43db90391a4b5f279d141edb63d3f1eedf2cad80 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 29 Jun 2016 06:49:20 +0930 Subject: [PATCH] daemon: fix case where commit has nothing to do. Prevents assert() triggering in queue_pkt_commit(). Signed-off-by: Rusty Russell --- daemon/peer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/daemon/peer.c b/daemon/peer.c index d52d33260..9eb917c04 100644 --- a/daemon/peer.c +++ b/daemon/peer.c @@ -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");