Skip to content

Commit

Permalink
df: add new config option for v2 opens --require_confirmed_inputs
Browse files Browse the repository at this point in the history
If set, require peers to only provide confirmed inputs for any v2 open
(both in accepter + opener role)
  • Loading branch information
niftynei authored and endothermicdev committed Feb 8, 2023
1 parent abb50c4 commit 442b479
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
3 changes: 2 additions & 1 deletion doc/lightning-listconfigs.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ On success, an object is returned, containing:
- **tor-service-password** (string, optional): `tor-service-password` field from config or cmdline, if any
- **dev-allowdustreserve** (boolean, optional): Whether we allow setting dust reserves
- **announce-addr-dns** (boolean, optional): Whether we put DNS entries into node\_announcement *(added v22.11.1)*
- **require-confirmed-inputs** (boolean, optional): Request peers to only send confirmed inputs (dual-fund only)

[comment]: # (GENERATE-FROM-SCHEMA-END)

Expand Down Expand Up @@ -222,4 +223,4 @@ RESOURCES

Main web site: <https://github.com/ElementsProject/lightning>

[comment]: # ( SHA256STAMP:11ff355ba2ee2d5c636cf140f54349a536f3d33554c3ec33fe2a096c0b6fb29c)
[comment]: # ( SHA256STAMP:581225b26efd84bfa99dc98e7a91e6fae11ef0b11939031d3da07f751f6d8f87)
8 changes: 6 additions & 2 deletions doc/schemas/listconfigs.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,12 @@
},
"announce-addr-dns": {
"type": "boolean",
"description": "Whether we put DNS entries into node_announcement",
"added": "v22.11.1"
"added": "v22.11.1",
"description": "Whether we put DNS entries into node_announcement"
},
"require-confirmed-inputs": {
"type": "boolean",
"description": "Request peers to only send confirmed inputs (dual-fund only)"
}
}
}
3 changes: 3 additions & 0 deletions lightningd/lightningd.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ struct config {
* slight spec incompatibility, but implementations do this
* already. */
bool allowdustreserve;

/* Require peer to send confirmed inputs */
bool require_confirmed_inputs;
};

typedef STRMAP(const char *) alt_subdaemon_map;
Expand Down
7 changes: 7 additions & 0 deletions lightningd/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,8 @@ static const struct config testnet_config = {
.exp_offers = IFEXPERIMENTAL(true, false),

.allowdustreserve = false,

.require_confirmed_inputs = false,
};

/* aka. "Dude, where's my coins?" */
Expand Down Expand Up @@ -927,6 +929,8 @@ static const struct config mainnet_config = {
.exp_offers = IFEXPERIMENTAL(true, false),

.allowdustreserve = false,

.require_confirmed_inputs = false,
};

static void check_config(struct lightningd *ld)
Expand Down Expand Up @@ -1180,6 +1184,9 @@ static void register_opts(struct lightningd *ld)
opt_register_arg("--funding-confirms", opt_set_u32, opt_show_u32,
&ld->config.anchor_confirms,
"Confirmations required for funding transaction");
opt_register_arg("--require-confirmed-inputs", opt_set_bool_arg, opt_show_bool,
&ld->config.require_confirmed_inputs,
"Confirmations required for inputs to funding transaction (v2 opens only)");
opt_register_arg("--cltv-delta", opt_set_u32, opt_show_u32,
&ld->config.cltv_expiry_delta,
"Number of blocks for cltv_expiry_delta");
Expand Down

0 comments on commit 442b479

Please sign in to comment.