Skip to content

Commit bb2cbaf

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

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

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)