Skip to content

Commit fb9f169

Browse files
committed
Assert usize is 32 or 64 bits, as required in a TODO
1 parent d5e316f commit fb9f169

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/ln/channelmanager.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,15 @@ impl ChannelHolder {
137137
by_id: &mut self.by_id,
138138
short_to_id: &mut self.short_to_id,
139139
next_forward: &mut self.next_forward,
140-
/// short channel id -> forward infos. Key of 0 means payments received
141140
forward_htlcs: &mut self.forward_htlcs,
142141
claimable_htlcs: &mut self.claimable_htlcs,
143142
}
144143
}
145144
}
146145

146+
#[cfg(not(any(target_pointer_width = "32", target_pointer_width = "64")))]
147+
const ERR: () = "You need at least 32 bit pointers (well, usize, but we'll assume they're the same) for ChannelManager::latest_block_height";
148+
147149
/// Manager which keeps track of a number of channels and sends messages to the appropriate
148150
/// channel, also tracking HTLC preimages and forwarding onion packets appropriately.
149151
/// Implements ChannelMessageHandler, handling the multi-channel parts and passing things through
@@ -157,7 +159,7 @@ pub struct ChannelManager {
157159

158160
announce_channels_publicly: bool,
159161
fee_proportional_millionths: u32,
160-
latest_block_height: AtomicUsize, //TODO: Compile-time assert this is at least 32-bits long
162+
latest_block_height: AtomicUsize,
161163
secp_ctx: Secp256k1,
162164

163165
channel_state: Mutex<ChannelHolder>,

0 commit comments

Comments
 (0)