mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 00:41:08 +00:00
Use safe math when pruning statuses (#1835)
Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
This commit is contained in:
@@ -1129,7 +1129,7 @@ impl<T: Config> XcmpMessageSource for Pallet<T> {
|
||||
let pruned = old_statuses_len - statuses.len();
|
||||
// removing an item from status implies a message being sent, so the result messages must
|
||||
// be no less than the pruned channels.
|
||||
statuses.rotate_left(result.len() - pruned);
|
||||
statuses.rotate_left(result.len().saturating_sub(pruned));
|
||||
|
||||
<OutboundXcmpStatus<T>>::put(statuses);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user