Skip to content

Commit 8b4c5a3

Browse files
committed
f note that u16 <= 0xffff is trivial
1 parent 30699ea commit 8b4c5a3

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

lightning/src/ln/channel.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3339,11 +3339,6 @@ impl<ChanSigner: ChannelKeys> Channel<ChanSigner> {
33393339
channel_id: self.channel_id(),
33403340
data: "funding tx had wrong script/value".to_owned()
33413341
});
3342-
} else if txo_idx > 0xff_ff {
3343-
return Err(msgs::ErrorMessage {
3344-
channel_id: self.channel_id(),
3345-
data: "funding tx output was > 2**16 which makes short_channel_id impossible to calculate".to_owned()
3346-
});
33473342
} else {
33483343
if self.channel_outbound {
33493344
for input in tx.input.iter() {
@@ -3358,6 +3353,7 @@ impl<ChanSigner: ChannelKeys> Channel<ChanSigner> {
33583353
if height > 0xff_ff_ff || (*index_in_block) > 0xff_ff_ff {
33593354
panic!("Block was bogus - either height 16 million or had > 16 million transactions");
33603355
}
3356+
assert!(txo_idx <= 0xffff); // txo_idx is a (u16 as usize), so this is just listed here for completeness
33613357
self.funding_tx_confirmations = 1;
33623358
self.short_channel_id = Some(((height as u64) << (5*8)) |
33633359
((*index_in_block as u64) << (2*8)) |

0 commit comments

Comments
 (0)