mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-06 07:34:21 +01:00
config: add min-emergency-msat option.
For anchors, we need some sats sitting around in case we need to CPFP a close. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Added: Config: `min-emergency-msat` setting for (currently experimental!) anchor channels, to keep funds in reserve for forced closes.
This commit is contained in:
@@ -322,6 +322,19 @@ static struct lightningd *new_lightningd(const tal_t *ctx)
|
||||
* case this is a pointer to an enum feerate-indexed array of values */
|
||||
ld->force_feerates = NULL;
|
||||
|
||||
/*~ We need some funds to help CPFP spend unilateral closes. How
|
||||
* much? But let's assume we want to boost the commitment tx (1112
|
||||
* Sipa).
|
||||
*
|
||||
* Anchor witness script is 40 bytes, sig is 72, input bytes is 32 + 4
|
||||
* + 1 + 1 + 4, core is 10 bytes, P2WKH output is 8 + 1 + 1 + 1 + 32
|
||||
* bytes. Weight (40 + 42 + 10 + 43)*4 + 40 + 72 = 652.
|
||||
*
|
||||
* So every 441 sats we can increase feerate by 1 sat / vbyte. Set
|
||||
* the default minimum at 25,000 sats.
|
||||
*/
|
||||
ld->emergency_sat = AMOUNT_SAT(25000);
|
||||
|
||||
return ld;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user