FRAME: Minor fix for failsafe. (#13741)

* max instead of min

* Remove debug stuff

* remove debug code

* warn log on no provider ref

* format string for log

---------

Co-authored-by: muharem <ismailov.m.h@gmail.com>
This commit is contained in:
Gavin Wood
2023-04-01 23:59:37 +02:00
committed by GitHub
parent 197b8d6571
commit d997103476
2 changed files with 8 additions and 8 deletions
+6 -1
View File
@@ -786,7 +786,12 @@ pub mod pallet {
// Gah!! We have a non-zero reserve balance but no provider refs :(
// This shouldn't practically happen, but we need a failsafe anyway: let's give
// them enough for an ED.
a.free = a.free.min(Self::ed());
log::warn!(
target: LOG_TARGET,
"account with a non-zero reserve balance has no provider refs, account_id: '{:?}'.",
who
);
a.free = a.free.max(Self::ed());
system::Pallet::<T>::inc_providers(who);
}
let _ = system::Pallet::<T>::inc_consumers(who).defensive();