projects
/
rust-lightning
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add PendingHTLCRouting variant for receiving keysend payments
[rust-lightning]
/
lightning
/
src
/
ln
/
channelmanager.rs
diff --git
a/lightning/src/ln/channelmanager.rs
b/lightning/src/ln/channelmanager.rs
index 4d67d5115f670ec6cb2e48bee282a428c4d46a18..19a8ad082f87a5191f78df8f744675b2fdb8edce 100644
(file)
--- a/
lightning/src/ln/channelmanager.rs
+++ b/
lightning/src/ln/channelmanager.rs
@@
-99,6
+99,10
@@
enum PendingHTLCRouting {
payment_data: msgs::FinalOnionHopData,
incoming_cltv_expiry: u32, // Used to track when we should expire pending HTLCs that go unclaimed
},
payment_data: msgs::FinalOnionHopData,
incoming_cltv_expiry: u32, // Used to track when we should expire pending HTLCs that go unclaimed
},
+ ReceiveKeysend {
+ payment_preimage: PaymentPreimage,
+ incoming_cltv_expiry: u32, // Used to track when we should expire pending HTLCs that go unclaimed
+ },
}
#[derive(Clone)] // See Channel::revoke_and_ack for why, tl;dr: Rust bug
}
#[derive(Clone)] // See Channel::revoke_and_ack for why, tl;dr: Rust bug
@@
-3318,6
+3322,7
@@
impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
match channel_state.forward_htlcs.entry(match forward_info.routing {
PendingHTLCRouting::Forward { short_channel_id, .. } => short_channel_id,
PendingHTLCRouting::Receive { .. } => 0,
match channel_state.forward_htlcs.entry(match forward_info.routing {
PendingHTLCRouting::Forward { short_channel_id, .. } => short_channel_id,
PendingHTLCRouting::Receive { .. } => 0,
+ PendingHTLCRouting::ReceiveKeysend { .. } => 0,
}) {
hash_map::Entry::Occupied(mut entry) => {
entry.get_mut().push(HTLCForwardInfo::AddHTLC { prev_short_channel_id, prev_funding_outpoint,
}) {
hash_map::Entry::Occupied(mut entry) => {
entry.get_mut().push(HTLCForwardInfo::AddHTLC { prev_short_channel_id, prev_funding_outpoint,
@@
-4471,7
+4476,11
@@
impl_writeable_tlv_based_enum!(PendingHTLCRouting,
(1, Receive) => {
(0, payment_data, required),
(2, incoming_cltv_expiry, required),
(1, Receive) => {
(0, payment_data, required),
(2, incoming_cltv_expiry, required),
- }
+ },
+ (2, ReceiveKeysend) => {
+ (0, payment_preimage, required),
+ (2, incoming_cltv_expiry, required),
+ },
;);
impl_writeable_tlv_based!(PendingHTLCInfo, {
;);
impl_writeable_tlv_based!(PendingHTLCInfo, {