Skip to content

Commit

Permalink
experimental: hide the jamming_endorsement under an experimetal flag
Browse files Browse the repository at this point in the history
Signed-off-by: Vincenzo Palazzo <[email protected]>
  • Loading branch information
vincenzopalazzo committed Oct 18, 2023
1 parent 92811f4 commit ea0d732
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lightningd/lightningd.h
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,9 @@ struct lightningd {
/* --experimental-upgrade-protocol */
bool experimental_upgrade_protocol;

/* --experimental-jamming */
bool experimental_jamming_endorsement;

/* For anchors: how much do we keep for spending close txs? */
struct amount_sat emergency_sat;

Expand Down
4 changes: 4 additions & 0 deletions lightningd/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -1577,6 +1577,10 @@ static void register_opts(struct lightningd *ld)
opt_register_noarg("--experimental-upgrade-protocol",
opt_set_bool, &ld->experimental_upgrade_protocol,
"experimental: allow channel types to be upgraded on reconnect");

opt_register_noarg("--experimental-jamming-endorsement",
opt_set_bool, &ld->experimental_jamming_endorsement,
"experimental: allow htlc endorsement to mitigate channel jamming (incomplete)");
clnopt_witharg("--database-upgrade", OPT_SHOWBOOL,
opt_set_db_upgrade, NULL,
ld,
Expand Down
5 changes: 4 additions & 1 deletion lightningd/peer_htlcs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1449,7 +1449,10 @@ static bool peer_accepted_htlc(const tal_t *ctx,
* we're in hook */
hook_payload->fwd_channel_id
= calc_forwarding_channel(ld, hook_payload);

// FIXME(vincenzopalazzo): ok this do not looks right, the value of
// hook_payload->endorsed should came from the prious pear of from us
// if we are the sender.
hook_payload->endorsed = ld->experimental_jamming_endorsement ? false : NULL;
plugin_hook_call_htlc_accepted(ld, NULL, hook_payload);

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

0 comments on commit ea0d732

Please sign in to comment.