From 78034dbcb406c14c46a6ea7e00ec5900f7eb5fa8 Mon Sep 17 00:00:00 2001 From: librelois <c@elo.tf> Date: Sat, 4 Jun 2022 12:13:46 +0200 Subject: [PATCH] fix(account):if new account can't pay NewAccountTax, it must be removed --- pallets/duniter-account/src/lib.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pallets/duniter-account/src/lib.rs b/pallets/duniter-account/src/lib.rs index 87ce357ff..c6f0a1888 100644 --- a/pallets/duniter-account/src/lib.rs +++ b/pallets/duniter-account/src/lib.rs @@ -198,13 +198,11 @@ pub mod pallet { total_weight += 200_000; } } else { - // The charges could not be deducted, we slash the account + // The charges could not be deducted, we must destroy the account let balance_to_suppr = account_data.free.saturating_add(account_data.reserved); // Force account data supression - frame_system::Account::<T>::mutate(&account_id, |a| { - a.data.set_balances(Default::default()) - }); + frame_system::Account::<T>::remove(&account_id); Self::deposit_event(Event::ForceDestroy { who: account_id, balance: balance_to_suppr, -- GitLab