Skip to content

Commit 2257f68

Browse files
committed
Fix multiplication overflow when logging hold times.
With large reported hold times, the unit multiplication may exceed u32.
1 parent c48e0a8 commit 2257f68

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lightning/src/ln/onion_utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1226,7 +1226,7 @@ where
12261226
logger,
12271227
"Htlc hold time at pos {}: {} ms",
12281228
route_hop_idx,
1229-
hold_time * HOLD_TIME_UNIT_MILLIS as u32
1229+
(hold_time as u128) * HOLD_TIME_UNIT_MILLIS
12301230
);
12311231

12321232
// Shift attribution data to prepare for processing the next hop.

0 commit comments

Comments
 (0)