core-lightning/lightningd/feerate.h
Rusty Russell 64b1ddd761 lightningd: clean up feerate handling, deprecate old terms.
Drop try_get_feerate() in favor of explicit feerate_for_deadline() and
smoothed_feerate_for_deadline().

This shows us everywhere we deal with old-style feerates by names.

`delayed_to_us` and `htlc_resolution` will be moving to dynamic fees,
so deprecate those.

Note that "penalty" is still used for generating penalty txs for
watchtowers, and "unilateral_close" still used until we get zero-fee
anchors.

Changelog-Added: JSON-RPC: `feerates` `estimates` array shows fee estimates by blockcount from underlying plugin (usually *bcli*).
Changelog-Changed: JSON-RPC: `close`, `fundchannel`, `fundpsbt`, `multifundchannel`, `multiwithdraw`, `txprepare`, `upgradewallet`, `withdraw` `feerate` (`feerange` for `close`) value *slow* is now 100 block-estimate, not half of 100-block estimate.
Changelog-Deprecated: JSON-RPC: `close`, `fundchannel`, `fundpsbt`, `multifundchannel`, `multiwithdraw`, `txprepare`, `upgradewallet`, `withdraw` `feerate` (`feerange` for `close`) expressed as, "delayed_to_us", "htlc_resolution", "max_acceptable" or "min_acceptable".  Use explicit block counts or *slow*/*normal*/*urgent*/*minimum*.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-04-10 07:31:12 +09:30

43 lines
1.2 KiB
C

#ifndef LIGHTNING_LIGHTNINGD_FEERATE_H
#define LIGHTNING_LIGHTNINGD_FEERATE_H
#include "config.h"
#include <bitcoin/feerate.h>
#include <common/json_parse_simple.h>
struct command;
enum feerate {
/* DO NOT REORDER: force-feerates uses this order! */
FEERATE_OPENING,
FEERATE_MUTUAL_CLOSE,
FEERATE_UNILATERAL_CLOSE,
FEERATE_DELAYED_TO_US,
FEERATE_HTLC_RESOLUTION,
FEERATE_PENALTY,
FEERATE_MIN,
FEERATE_MAX,
};
#define NUM_FEERATES (FEERATE_MAX+1)
const char *feerate_name(enum feerate feerate);
/* Extract a feerate style. */
struct command_result *param_feerate_style(struct command *cmd,
const char *name,
const char *buffer,
const jsmntok_t *tok,
enum feerate_style **style);
/* Extract a feerate with optional style suffix. */
struct command_result *param_feerate_val(struct command *cmd,
const char *name, const char *buffer,
const jsmntok_t *tok,
u32 **feerate_per_kw);
/* This also accepts names like "slow" etc */
struct command_result *param_feerate(struct command *cmd, const char *name,
const char *buffer, const jsmntok_t *tok,
u32 **feerate);
#endif /* LIGHTNING_LIGHTNINGD_FEERATE_H */