From ffd5c220924118bf54e5bba6b41499721dffde7c Mon Sep 17 00:00:00 2001 From: Gav Date: Tue, 11 Apr 2023 14:35:53 +0100 Subject: [PATCH] Force incrementing of consumers --- frame/balances/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frame/balances/src/lib.rs b/frame/balances/src/lib.rs index dcf602cd5e0bf..029a170535a10 100644 --- a/frame/balances/src/lib.rs +++ b/frame/balances/src/lib.rs @@ -782,8 +782,8 @@ pub mod pallet { } a.flags.set_new_logic(); if !a.reserved.is_zero() || !a.frozen.is_zero() { - if !system::Pallet::::can_inc_consumer(who) { - // Gah!! We have a non-zero reserve balance but no provider refs :( + if system::Pallet::::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::::inc_providers(who); } - let _ = system::Pallet::::inc_consumers(who).defensive(); + let _ = system::Pallet::::inc_consumers_without_limit(who).defensive(); } // Should never fail - we're only setting a bit. let _ = T::AccountStore::try_mutate_exists(who, |account| -> DispatchResult {