Skip to content

Commit f54ebf7

Browse files
committed
Add support for deserializing the new SCID alias in funding_locked
1 parent a274261 commit f54ebf7

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

lightning/src/ln/channel.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3457,6 +3457,7 @@ impl<Signer: Sign> Channel<Signer> {
34573457
Some(msgs::FundingLocked {
34583458
channel_id: self.channel_id(),
34593459
next_per_commitment_point,
3460+
short_channel_id_alias: None,
34603461
})
34613462
} else { None };
34623463

@@ -3678,6 +3679,7 @@ impl<Signer: Sign> Channel<Signer> {
36783679
funding_locked: Some(msgs::FundingLocked {
36793680
channel_id: self.channel_id(),
36803681
next_per_commitment_point,
3682+
short_channel_id_alias: None,
36813683
}),
36823684
raa: None, commitment_update: None, mon_update: None,
36833685
order: RAACommitmentOrder::CommitmentFirst,
@@ -3713,6 +3715,7 @@ impl<Signer: Sign> Channel<Signer> {
37133715
Some(msgs::FundingLocked {
37143716
channel_id: self.channel_id(),
37153717
next_per_commitment_point,
3718+
short_channel_id_alias: None,
37163719
})
37173720
} else { None };
37183721

@@ -4447,6 +4450,7 @@ impl<Signer: Sign> Channel<Signer> {
44474450
return Some(msgs::FundingLocked {
44484451
channel_id: self.channel_id,
44494452
next_per_commitment_point,
4453+
short_channel_id_alias: None,
44504454
});
44514455
}
44524456
} else {

lightning/src/ln/msgs.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,9 @@ pub struct FundingLocked {
241241
pub channel_id: [u8; 32],
242242
/// The per-commitment point of the second commitment transaction
243243
pub next_per_commitment_point: PublicKey,
244+
/// If set, provides a short_channel_id alias for this channel. The sender will accept payments
245+
/// to be forwarded over this SCID and forward them to this messages' recipient.
246+
pub short_channel_id_alias: Option<u64>,
244247
}
245248

246249
/// A shutdown message to be sent or received from a peer
@@ -1155,7 +1158,9 @@ impl_writeable_msg!(FundingSigned, {
11551158
impl_writeable_msg!(FundingLocked, {
11561159
channel_id,
11571160
next_per_commitment_point,
1158-
}, {});
1161+
}, {
1162+
(1, short_channel_id_alias, option),
1163+
});
11591164

11601165
impl Writeable for Init {
11611166
fn write<W: Writer>(&self, w: &mut W) -> Result<(), io::Error> {
@@ -2246,6 +2251,7 @@ mod tests {
22462251
let funding_locked = msgs::FundingLocked {
22472252
channel_id: [2; 32],
22482253
next_per_commitment_point: pubkey_1,
2254+
short_channel_id_alias: None,
22492255
};
22502256
let encoded_value = funding_locked.encode();
22512257
let target_value = hex::decode("0202020202020202020202020202020202020202020202020202020202020202031b84c5567b126440995d3ed5aaba0565d71e1834604819ff9c17f5e9d5dd078f").unwrap();

0 commit comments

Comments
 (0)