mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 04:11:07 +00:00
incrementing sufficient accounts references with saturating_add for safety. (#2768)
Even though it is difficult to overflow the sufficients variable, since an attacker that is willing to rapidly increase the number must every time deposit a minimum deposit of a given asset, it is safer to use saturating_add(). --------- Co-authored-by: Bastian Köcher <git@kchr.de> Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
This commit is contained in:
@@ -77,7 +77,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
|
||||
}
|
||||
} else if d.is_sufficient {
|
||||
frame_system::Pallet::<T>::inc_sufficients(who);
|
||||
d.sufficients += 1;
|
||||
d.sufficients.saturating_inc();
|
||||
ExistenceReason::Sufficient
|
||||
} else {
|
||||
frame_system::Pallet::<T>::inc_consumers(who)
|
||||
|
||||
Reference in New Issue
Block a user