Skip to content

Commit 282ee1a

Browse files
committed
Use u32 instead of usize in Retry::Attempts
An upcoming commit requires serializing Retry, so use a type with a fixed byte length. Otherwise, using eight bytes to serialize a usize would fail to read on 32-bit machines.
1 parent eddf3b7 commit 282ee1a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lightning/src/ln/outbound_payment.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ pub enum Retry {
263263
/// Each attempt may be multiple HTLCs along multiple paths if the router decides to split up a
264264
/// retry, and may retry multiple failed HTLCs at once if they failed around the same time and
265265
/// were retried along a route from a single call to [`Router::find_route_with_id`].
266-
Attempts(usize),
266+
Attempts(u32),
267267
#[cfg(not(feature = "no-std"))]
268268
/// Time elapsed before abandoning retries for a payment. At least one attempt at payment is made;
269269
/// see [`PaymentParameters::expiry_time`] to avoid any attempt at payment after a specific time.
@@ -305,7 +305,7 @@ pub(crate) type PaymentAttempts = PaymentAttemptsUsingTime<ConfiguredTime>;
305305
pub(crate) struct PaymentAttemptsUsingTime<T: Time> {
306306
/// This count will be incremented only after the result of the attempt is known. When it's 0,
307307
/// it means the result of the first attempt is not known yet.
308-
pub(crate) count: usize,
308+
pub(crate) count: u32,
309309
/// This field is only used when retry is `Retry::Timeout` which is only build with feature std
310310
#[cfg(not(feature = "no-std"))]
311311
first_attempted_at: T,

0 commit comments

Comments
 (0)