Skip to content

Commit 0178a29

Browse files
experimental: hide the jamming_endorsement under an experimetal flag
Signed-off-by: Vincenzo Palazzo <[email protected]>
1 parent 2f60b4c commit 0178a29

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

doc/lightningd-config.5.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -787,6 +787,11 @@ don't have to use a worst-case fee, but can bump the commitment transaction
787787
if it's needed. Note that this means that we need to keep
788788
some funds aside: see `min-emergency-msat`.
789789

790+
* **experimental-jamming-endorsement**
791+
792+
Specifying this option turn on part of the Channel Jamming mitigation
793+
to forward the `endorsed` inside `update_add_htl` lightning message.
794+
790795
BUGS
791796
----
792797

lightningd/lightningd.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,9 @@ struct lightningd {
382382
/* --experimental-upgrade-protocol */
383383
bool experimental_upgrade_protocol;
384384

385+
/* --experimental-jamming */
386+
bool experimental_jamming_endorsement;
387+
385388
/* For anchors: how much do we keep for spending close txs? */
386389
struct amount_sat emergency_sat;
387390

lightningd/options.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1577,6 +1577,10 @@ static void register_opts(struct lightningd *ld)
15771577
opt_register_noarg("--experimental-upgrade-protocol",
15781578
opt_set_bool, &ld->experimental_upgrade_protocol,
15791579
"experimental: allow channel types to be upgraded on reconnect");
1580+
1581+
opt_register_noarg("--experimental-jamming-endorsement",
1582+
opt_set_bool, &ld->experimental_jamming_endorsement,
1583+
"experimental: allow htlc endorsement to mitigate channel jamming (incomplete)");
15801584
clnopt_witharg("--database-upgrade", OPT_SHOWBOOL,
15811585
opt_set_db_upgrade, NULL,
15821586
ld,

lightningd/peer_htlcs.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1449,7 +1449,10 @@ static bool peer_accepted_htlc(const tal_t *ctx,
14491449
* we're in hook */
14501450
hook_payload->fwd_channel_id
14511451
= calc_forwarding_channel(ld, hook_payload);
1452-
1452+
// FIXME(vincenzopalazzo): ok this do not looks right, the value of
1453+
// hook_payload->endorsed should came from the prious pear of from us
1454+
// if we are the sender.
1455+
hook_payload->endorsed = ld->experimental_jamming_endorsement ? false : NULL;
14531456
plugin_hook_call_htlc_accepted(ld, NULL, hook_payload);
14541457

14551458
/* Falling through here is ok, after all the HTLC locked */

0 commit comments

Comments
 (0)