From 2f1414362c5e26ce482a9e25fd97b24cd22ad02f Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 25 Sep 2015 11:51:19 +0930 Subject: [PATCH] state: Don't change priority on decline. This means it's always reflects the bottom bit (maybe inverted) of the commit tx number. Signed-off-by: Rusty Russell --- state.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/state.c b/state.c index 4f39691c3..95bcedcee 100644 --- a/state.c +++ b/state.c @@ -397,8 +397,8 @@ enum state state(const enum state state, const struct state_data *sdata, if (input_is(input, PKT_UPDATE_DECLINE_HTLC)) { fail_cmd(effect, CMD_SEND_HTLC_UPDATE, idata->pkt); set_effect(effect, htlc_abandon, true); - /* Toggle between high and low priority states. */ - return toggle_prio(state, STATE_NORMAL); + /* No update means no priority change. */ + return prio(state, STATE_NORMAL); /* They can't close with an HTLC, so only possible here */ } else if (input_is(input, PKT_CLOSE)) { fail_cmd(effect, CMD_SEND_UPDATE_ANY, NULL); @@ -979,8 +979,8 @@ accept_htlc_update: goto err_start_unilateral_close; if (decline) { set_effect(effect, send, decline); - /* Toggle between high/low priority states. */ - return toggle_prio(state, STATE_NORMAL); + /* No update means no priority change. */ + return prio(state, STATE_NORMAL); } set_effect(effect, htlc_in_progress, htlcprog); set_effect(effect, send, pkt_update_accept(effect, sdata));