Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 56 additions & 2 deletions .msggen.json
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,8 @@
},
"FeeratesPerkb": {
"Feerates.perkb.delayed_to_us": 6,
"Feerates.perkb.estimates[]": 9,
"Feerates.perkb.floor": 10,
"Feerates.perkb.htlc_resolution": 7,
"Feerates.perkb.max_acceptable": 2,
"Feerates.perkb.min_acceptable": 1,
Expand All @@ -365,8 +367,15 @@
"Feerates.perkb.penalty": 8,
"Feerates.perkb.unilateral_close": 5
},
"FeeratesPerkbEstimates": {
"Feerates.perkb.estimates[].blockcount": 1,
"Feerates.perkb.estimates[].feerate": 2,
"Feerates.perkb.estimates[].smoothed_feerate": 3
},
"FeeratesPerkw": {
"Feerates.perkw.delayed_to_us": 6,
"Feerates.perkw.estimates[]": 9,
"Feerates.perkw.floor": 10,
"Feerates.perkw.htlc_resolution": 7,
"Feerates.perkw.max_acceptable": 2,
"Feerates.perkw.min_acceptable": 1,
Expand All @@ -375,6 +384,11 @@
"Feerates.perkw.penalty": 8,
"Feerates.perkw.unilateral_close": 5
},
"FeeratesPerkwEstimates": {
"Feerates.perkw.estimates[].blockcount": 1,
"Feerates.perkw.estimates[].feerate": 2,
"Feerates.perkw.estimates[].smoothed_feerate": 3
},
"FeeratesRequest": {
"Feerates.style": 1
},
Expand Down Expand Up @@ -1542,11 +1556,31 @@
},
"Feerates.perkb.delayed_to_us": {
"added": "pre-v0.10.1",
"deprecated": "v23.05"
},
"Feerates.perkb.estimates[]": {
"added": "v23.05",
"deprecated": false
},
"Feerates.perkb.estimates[].blockcount": {
"added": "v23.05",
"deprecated": false
},
"Feerates.perkb.estimates[].feerate": {
"added": "v23.05",
"deprecated": false
},
"Feerates.perkb.estimates[].smoothed_feerate": {
"added": "v23.05",
"deprecated": false
},
"Feerates.perkb.floor": {
"added": "v23.05",
"deprecated": false
},
"Feerates.perkb.htlc_resolution": {
"added": "pre-v0.10.1",
"deprecated": false
"deprecated": "v23.05"
},
"Feerates.perkb.max_acceptable": {
"added": "pre-v0.10.1",
Expand Down Expand Up @@ -1578,11 +1612,31 @@
},
"Feerates.perkw.delayed_to_us": {
"added": "pre-v0.10.1",
"deprecated": "v23.05"
},
"Feerates.perkw.estimates[]": {
"added": "v23.05",
"deprecated": false
},
"Feerates.perkw.estimates[].blockcount": {
"added": "v23.05",
"deprecated": false
},
"Feerates.perkw.estimates[].feerate": {
"added": "v23.05",
"deprecated": false
},
"Feerates.perkw.estimates[].smoothed_feerate": {
"added": "v23.05",
"deprecated": false
},
"Feerates.perkw.floor": {
"added": "v23.05",
"deprecated": false
},
"Feerates.perkw.htlc_resolution": {
"added": "pre-v0.10.1",
"deprecated": false
"deprecated": "v23.05"
},
"Feerates.perkw.max_acceptable": {
"added": "pre-v0.10.1",
Expand Down
4 changes: 4 additions & 0 deletions bitcoin/feerate.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
#include "config.h"
#include <assert.h>
#include <bitcoin/feerate.h>

u32 feerate_from_style(u32 feerate, enum feerate_style style)
{
/* Make sure it's called somewhere! */
assert(feerate_floor_check() == FEERATE_FLOOR);

switch (style) {
case FEERATE_PER_KSIPA:
return feerate;
Expand Down
2 changes: 1 addition & 1 deletion bitcoin/feerate.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ enum feerate_style {
FEERATE_PER_KBYTE
};

static inline u32 feerate_floor(void)
static inline u32 feerate_floor_check(void)
{
/* Assert that bitcoind will see this as above minRelayTxFee */
BUILD_ASSERT(FEERATE_BITCOIND_SEES(FEERATE_FLOOR, MINIMUM_TX_WEIGHT)
Expand Down
4 changes: 3 additions & 1 deletion channeld/watchtower.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ penalty_tx_create(const tal_t *ctx,

if (amount_sat_less(to_them_sats, min_out)) {
/* FIXME: We should use SIGHASH_NONE so others can take it */
fee = amount_tx_fee(feerate_floor(), weight);
/* We use the minimum possible fee here; if it doesn't
* propagate, who cares? */
fee = amount_tx_fee(FEERATE_FLOOR, weight);
}

/* This can only happen if feerate_floor() is still too high; shouldn't
Expand Down
16 changes: 16 additions & 0 deletions cln-grpc/proto/node.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 56 additions & 0 deletions cln-grpc/src/convert.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions cln-rpc/src/model.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions common/jsonrpc_errors.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ enum jsonrpc_errcode {

/* bitcoin-cli plugin errors */
BCLI_ERROR = 500,
BCLI_NO_FEE_ESTIMATES = 501,

/* Errors from `invoice` or `delinvoice` commands */
INVOICE_LABEL_ALREADY_EXISTS = 900,
Expand Down
13 changes: 12 additions & 1 deletion common/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,22 @@ void clear_softref_(const tal_t *outer, size_t outersize, void **ptr);
* Remove an element from an array
*
* This will shift the elements past the removed element, changing
* their position in memory, so only use this for arrays of pointers.
* their position in memory, so only use this for simple arrays.
*/
#define tal_arr_remove(p, n) tal_arr_remove_((p), sizeof(**p), (n))
void tal_arr_remove_(void *p, size_t elemsize, size_t n);

/**
* Insert an element in an array
*/
#define tal_arr_insert(p, n, v) \
do { \
size_t n_ = tal_count(*(p)); \
tal_resize((p), n_+1); \
memmove(*(p) + n + 1, *(p) + n, (n_ - n) * sizeof(**(p))); \
(*(p))[n] = (v); \
} while(0)

/* Check for valid UTF-8 */
bool utf8_check(const void *buf, size_t buflen);

Expand Down
Loading