Skip to content

Commit 88f8e63

Browse files
niftyneirustyrussell
authored andcommitted
funder-rbf: correctly iniitalize lease params
We weren't initializing lease params, which was leading to undefined behavior for rbfs
1 parent 5c7d2f0 commit 88f8e63

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

doc/lightning-openchannel_bump.7

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/lightning-openchannel_bump.7.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ is not met.
3030
funding transaction. Defaults to 1/64th greater than the last
3131
feerate used for this channel.
3232

33+
Warning: bumping a leased channel will lose the lease.
34+
3335
RETURN VALUE
3436
------------
3537

plugins/funder.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,17 @@ struct open_info {
288288
struct amount_sat requested_lease;
289289
};
290290

291+
static struct open_info *new_open_info(const tal_t *ctx)
292+
{
293+
struct open_info *info = tal(ctx, struct open_info);
294+
295+
info->requested_lease = AMOUNT_SAT(0);
296+
info->lease_blockheight = 0;
297+
info->node_blockheight = 0;
298+
299+
return info;
300+
}
301+
291302
static struct command_result *
292303
psbt_funded(struct command *cmd,
293304
const char *buf,
@@ -641,7 +652,7 @@ json_rbf_channel_call(struct command *cmd,
641652
const char *buf,
642653
const jsmntok_t *params)
643654
{
644-
struct open_info *info = tal(cmd, struct open_info);
655+
struct open_info *info = new_open_info(cmd);
645656
u64 feerate_our_max, feerate_our_min;
646657
const char *err;
647658
struct out_req *req;

0 commit comments

Comments
 (0)