channel: update fees after lockin.

We don't respond to fee changes until we're locked in: make sure we catch
up at that point.

Note that we use NORMAL fees during opening, but IMMEDIATE after, so
this often sends a fee update.  The tests which break, we set those
feerates to be equal.

This (sometimes) changes the behavior of test_permfail, as we now
get an immediate commit, so that is fixed too so we always wait for
that to complete.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2018-08-23 08:57:17 +09:30
parent 6338ae8a44
commit 607d4bf9d2
5 changed files with 58 additions and 22 deletions

View File

@@ -25,6 +25,10 @@ static void lockin_complete(struct channel *channel)
/* We set this once they're locked in. */
assert(channel->remote_funding_locked);
channel_set_state(channel, CHANNELD_AWAITING_LOCKIN, CHANNELD_NORMAL);
/* Fees might have changed (and we use IMMEDIATE once we're funded),
* so update now. */
try_update_feerates(channel->peer->ld, channel);
}
/* We were informed by channeld that it announced the channel and sent