Skip to content

Commit bf3deb0

Browse files
committed
lightningd: rename anchor_confirms to funding_confirms.
Calling the funding tx an anchor is pre-spec terminology, which is now confusing; let's rename the variable. Signed-off-by: Rusty Russell <[email protected]>
1 parent 71eb040 commit bf3deb0

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

lightningd/dual_open_control.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -4122,7 +4122,7 @@ bool peer_start_dualopend(struct peer *peer,
41224122
* funding transaction.
41234123
*/
41244124
/* FIXME: We should override this to 0 in the openchannel2 hook of we want zeroconf*/
4125-
channel->minimum_depth = peer->ld->config.anchor_confirms;
4125+
channel->minimum_depth = peer->ld->config.funding_confirms;
41264126

41274127
msg = towire_dualopend_init(NULL, chainparams,
41284128
peer->ld->our_features,

lightningd/lightningd.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ struct config {
2121
/* How long do we let them lock up our funds? (blocks: 2016 by spec) */
2222
u32 max_htlc_cltv;
2323

24-
/* How many confirms until we consider an anchor "settled". */
25-
u32 anchor_confirms;
24+
/* How many confirms until we consider a funding tx "settled". */
25+
u32 funding_confirms;
2626

2727
/* Minimum CLTV to subtract from incoming HTLCs to outgoing */
2828
u32 cltv_expiry_delta;

lightningd/opening_common.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ new_uncommitted_channel(struct peer *peer)
6262
* funding transaction.
6363
*/
6464
/* We override this in openchannel hook if we want zeroconf */
65-
uc->minimum_depth = ld->config.anchor_confirms;
65+
uc->minimum_depth = ld->config.funding_confirms;
6666

6767
/* Use default 1% reserve if not otherwise specified. If this
6868
* is not-NULL it will be used by openingd as absolute value

lightningd/opening_control.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1294,7 +1294,7 @@ static struct command_result *json_fundchannel_start(struct command *cmd,
12941294
}
12951295

12961296
if (!mindepth)
1297-
mindepth = tal_dup(cmd, u32, &cmd->ld->config.anchor_confirms);
1297+
mindepth = tal_dup(cmd, u32, &cmd->ld->config.funding_confirms);
12981298

12991299
if (push_msat && amount_msat_greater_sat(*push_msat, *amount))
13001300
return command_fail(cmd, FUND_CANNOT_AFFORD,

lightningd/options.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,7 @@ static const struct config testnet_config = {
957957
.max_htlc_cltv = 2016,
958958

959959
/* We're fairly trusting, under normal circumstances. */
960-
.anchor_confirms = 1,
960+
.funding_confirms = 1,
961961

962962
/* Testnet blockspace is free. */
963963
.max_concurrent_htlcs = 483,
@@ -1025,7 +1025,7 @@ static const struct config mainnet_config = {
10251025
.max_htlc_cltv = 2016,
10261026

10271027
/* We're fairly trusting, under normal circumstances. */
1028-
.anchor_confirms = 3,
1028+
.funding_confirms = 3,
10291029

10301030
/* While up to 483 htlcs are possible we do 30 by default (as eclair does) to save blockspace */
10311031
.max_concurrent_htlcs = 30,
@@ -1099,8 +1099,8 @@ static void check_config(struct lightningd *ld)
10991099
if (ld->config.max_concurrent_htlcs < 1 || ld->config.max_concurrent_htlcs > 483)
11001100
fatal("--max-concurrent-htlcs value must be between 1 and 483 it is: %u",
11011101
ld->config.max_concurrent_htlcs);
1102-
if (ld->config.anchor_confirms == 0)
1103-
fatal("anchor-confirms must be greater than zero");
1102+
if (ld->config.funding_confirms == 0)
1103+
fatal("funding-confirms must be greater than zero");
11041104

11051105
if (ld->always_use_proxy && !ld->proxyaddr)
11061106
fatal("--always-use-proxy needs --proxy");
@@ -1497,7 +1497,7 @@ static void register_opts(struct lightningd *ld)
14971497
opt_register_arg("--max-locktime-blocks", opt_set_max_htlc_cltv, NULL,
14981498
ld, opt_hidden);
14991499
clnopt_witharg("--funding-confirms", OPT_SHOWINT, opt_set_u32, opt_show_u32,
1500-
&ld->config.anchor_confirms,
1500+
&ld->config.funding_confirms,
15011501
"Confirmations required for funding transaction");
15021502
clnopt_witharg("--require-confirmed-inputs", OPT_SHOWBOOL,
15031503
opt_set_bool_arg, opt_show_bool,

0 commit comments

Comments
 (0)