From 13593d4cbf0cb5a17ad08f80765a879dae9558e4 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 13 Sep 2016 12:40:28 +0930 Subject: [PATCH] peer: don't try to change fees while we're still setting up channel. And add a FIXME about doing feechanges properly. Signed-off-by: Rusty Russell --- daemon/peer.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/daemon/peer.c b/daemon/peer.c index 8cee96647..0714c1e95 100644 --- a/daemon/peer.c +++ b/daemon/peer.c @@ -2968,10 +2968,14 @@ static enum watch_result anchor_depthchange(struct peer *peer, check_htlc_expiry(peer); /* If fee rate has changed, fire off update to change it. */ - if (peer->local.staging_cstate->fee_rate + if ((state_is_normal(peer->state) || state_is_shutdown(peer->state)) + && peer->local.staging_cstate->fee_rate != desired_commit_feerate(peer->dstate)) { log_debug(peer->log, "fee rate changed to %"PRIu64, desired_commit_feerate(peer->dstate)); + /* FIXME: If fee changes back before update, we screw + * up and send an empty commit. We need to generate a + * real packet here! */ remote_changes_pending(peer); }