closing: add option to set closing range.

This affects the range we offer even without quick-close, but it's
more critical for quick-close.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSONRPC: `close` now takes a `feerange` parameter to set min/max fee rates for mutual close.
This commit is contained in:
Rusty Russell
2021-09-08 14:11:46 +09:30
parent e12f9f0872
commit 6ee8c40b29
14 changed files with 136 additions and 14 deletions

View File

@@ -263,6 +263,7 @@ struct channel *new_unsaved_channel(struct peer *peer,
channel->closing_fee_negotiation_step_unit
= CLOSING_FEE_NEGOTIATION_STEP_UNIT_PERCENTAGE;
channel->shutdown_wrong_funding = NULL;
channel->closing_feerate_range = NULL;
/* Channel is connected! */
channel->connected = true;
@@ -429,6 +430,7 @@ struct channel *new_channel(struct peer *peer, u64 dbid,
= CLOSING_FEE_NEGOTIATION_STEP_UNIT_PERCENTAGE;
channel->shutdown_wrong_funding
= tal_steal(channel, shutdown_wrong_funding);
channel->closing_feerate_range = NULL;
if (local_shutdown_scriptpubkey)
channel->shutdown_scriptpubkey[LOCAL]
= tal_steal(channel, local_shutdown_scriptpubkey);