Skip to content

Commit 53a67b6

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 <rusty@rustcorp.com.au>
1 parent f816393 commit 53a67b6

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

lightningd/dual_open_control.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4126,7 +4126,7 @@ bool peer_start_dualopend(struct peer *peer,
41264126
* funding transaction.
41274127
*/
41284128
/* FIXME: We should override this to 0 in the openchannel2 hook of we want zeroconf*/
4129-
channel->minimum_depth = peer->ld->config.anchor_confirms;
4129+
channel->minimum_depth = peer->ld->config.funding_confirms;
41304130

41314131
msg = towire_dualopend_init(NULL, chainparams,
41324132
peer->ld->our_features,

lightningd/lightningd.h

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1301,7 +1301,7 @@ static struct command_result *json_fundchannel_start(struct command *cmd,
13011301
}
13021302

13031303
if (!mindepth)
1304-
mindepth = tal_dup(cmd, u32, &cmd->ld->config.anchor_confirms);
1304+
mindepth = tal_dup(cmd, u32, &cmd->ld->config.funding_confirms);
13051305

13061306
if (push_msat && amount_msat_greater_sat(*push_msat, *amount))
13071307
return command_fail(cmd, FUND_CANNOT_AFFORD,

lightningd/options.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,7 @@ static const struct config testnet_config = {
961961
.max_htlc_cltv = 2016,
962962

963963
/* We're fairly trusting, under normal circumstances. */
964-
.anchor_confirms = 1,
964+
.funding_confirms = 1,
965965

966966
/* Testnet blockspace is free. */
967967
.max_concurrent_htlcs = 483,
@@ -1029,7 +1029,7 @@ static const struct config mainnet_config = {
10291029
.max_htlc_cltv = 2016,
10301030

10311031
/* We're fairly trusting, under normal circumstances. */
1032-
.anchor_confirms = 3,
1032+
.funding_confirms = 3,
10331033

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

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

0 commit comments

Comments
 (0)