mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 07:34:24 +01:00
channeld: check if we want to change fees after sending revocation.
This may have made our feestates fully resolved, so we can send update_fee again. Without this fix our tests sometimes timeout. Also add debugging so we can see when we suppressed a feechange. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -1052,7 +1052,9 @@ static void send_commit(struct peer *peer)
|
|||||||
*/
|
*/
|
||||||
changed_htlcs = tal_arr(tmpctx, const struct htlc *, 0);
|
changed_htlcs = tal_arr(tmpctx, const struct htlc *, 0);
|
||||||
if (!channel_sending_commit(peer->channel, &changed_htlcs)) {
|
if (!channel_sending_commit(peer->channel, &changed_htlcs)) {
|
||||||
status_debug("Can't send commit: nothing to send");
|
status_debug("Can't send commit: nothing to send, feechange %s (%s)",
|
||||||
|
want_fee_update(peer, NULL) ? "wanted": "not wanted",
|
||||||
|
type_to_string(tmpctx, struct fee_states, peer->channel->fee_states));
|
||||||
|
|
||||||
/* Covers the case where we've just been told to shutdown. */
|
/* Covers the case where we've just been told to shutdown. */
|
||||||
maybe_send_shutdown(peer);
|
maybe_send_shutdown(peer);
|
||||||
@@ -1403,8 +1405,13 @@ static void handle_peer_commit_sig(struct peer *peer, const u8 *msg)
|
|||||||
status_debug("Received commit_sig with %zu htlc sigs",
|
status_debug("Received commit_sig with %zu htlc sigs",
|
||||||
tal_count(htlc_sigs));
|
tal_count(htlc_sigs));
|
||||||
|
|
||||||
return send_revocation(peer,
|
send_revocation(peer,
|
||||||
&commit_sig, htlc_sigs, changed_htlcs, txs[0]);
|
&commit_sig, htlc_sigs, changed_htlcs, txs[0]);
|
||||||
|
|
||||||
|
/* This might have synced the feerates: if so, we may want to
|
||||||
|
* update */
|
||||||
|
if (want_fee_update(peer, NULL))
|
||||||
|
start_commit_timer(peer);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Pops the penalty base for the given commitnum from our internal list. There
|
/* Pops the penalty base for the given commitnum from our internal list. There
|
||||||
|
|||||||
Reference in New Issue
Block a user