Skip to content
Snippets Groups Projects
Commit 83b63362 authored by Gavin Wood's avatar Gavin Wood Committed by GitHub
Browse files

Force incrementing of consumers (#13878)

parent 9c35b9c8
No related merge requests found
......@@ -782,8 +782,8 @@ pub mod pallet {
}
a.flags.set_new_logic();
if !a.reserved.is_zero() || !a.frozen.is_zero() {
if !system::Pallet::<T>::can_inc_consumer(who) {
// Gah!! We have a non-zero reserve balance but no provider refs :(
if system::Pallet::<T>::providers(who) == 0 {
// Gah!! We have no provider refs :(
// This shouldn't practically happen, but we need a failsafe anyway: let's give
// them enough for an ED.
log::warn!(
......@@ -794,7 +794,7 @@ pub mod pallet {
a.free = a.free.max(Self::ed());
system::Pallet::<T>::inc_providers(who);
}
let _ = system::Pallet::<T>::inc_consumers(who).defensive();
let _ = system::Pallet::<T>::inc_consumers_without_limit(who).defensive();
}
// Should never fail - we're only setting a bit.
let _ = T::AccountStore::try_mutate_exists(who, |account| -> DispatchResult {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment