Skip to content

Commit 44d21c9

Browse files
Add feature bit for HtlcHold
As part of supporting sending payments as an often-offline sender, the often-offline sender's channel counterparty needs to advertise a feature bit indicating that they support holding onto the sender's HTLC until they receive a release_held_htlc onion message from the recipient indicating that they are online and ready to receive the payment. See-also <lightning/bolts#989> We don't yet advertise support of this feature.
1 parent a24746f commit 44d21c9

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

lightning-types/src/features.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@
8282
//! (see [BOLT PR #1228](https://github.com/lightning/bolts/pull/1228) for more info).
8383
//! - `Splice` - Allows replacing the currently-locked funding transaction with a new one
8484
//! (see [BOLT PR #1160](https://github.com/lightning/bolts/pull/1160) for more information).
85+
//! - `HtlcHold` - requires/supports holding HTLCs and forwarding on receipt of an onion message
86+
//! (see [BOLT-2](https://github.com/lightning/bolts/pull/989/files) for more information).
8587
//!
8688
//! LDK knows about the following features, but does not support them:
8789
//! - `AnchorsNonzeroFeeHtlcTx` - the initial version of anchor outputs, which was later found to be
@@ -166,6 +168,10 @@ mod sealed {
166168
ZeroConf,
167169
// Byte 7
168170
Trampoline | SimpleClose | Splice,
171+
// Byte 8 - 130
172+
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
173+
// Byte 131
174+
HtlcHold,
169175
]
170176
);
171177
define_context!(
@@ -191,6 +197,10 @@ mod sealed {
191197
,,,,,,,,,,,,,,,,,,,,,,,,
192198
// Byte 32
193199
DnsResolver,
200+
// Byte 33 - 130
201+
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
202+
// Byte 131
203+
HtlcHold,
194204
]
195205
);
196206
define_context!(ChannelContext, []);
@@ -700,6 +710,17 @@ mod sealed {
700710
supports_dns_resolution,
701711
requires_dns_resolution
702712
);
713+
define_feature!(
714+
1053, // The BOLTs PR uses feature bit 52/53, so add +1000 for the experimental bit
715+
HtlcHold,
716+
[InitContext, NodeContext],
717+
"Feature flags for holding HTLCs and forwarding on receipt of an onion message",
718+
set_htlc_hold_optional,
719+
set_htlc_hold_required,
720+
clear_htlc_hold,
721+
supports_htlc_hold,
722+
requires_htlc_hold
723+
);
703724

704725
// Note: update the module-level docs when a new feature bit is added!
705726

0 commit comments

Comments
 (0)