From 4ff695cb82a8406fdb4f10c6ea023225ea5e778a Mon Sep 17 00:00:00 2001 From: brenzi Date: Tue, 27 Aug 2024 13:48:16 +0200 Subject: [PATCH] fix premature unlock with bond_extra (#267) --- teerdays/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/teerdays/src/lib.rs b/teerdays/src/lib.rs index f76591b3..18fb7e7a 100644 --- a/teerdays/src/lib.rs +++ b/teerdays/src/lib.rs @@ -201,6 +201,7 @@ pub mod pallet { #[pallet::compact] value: BalanceOf, ) -> DispatchResult { let signer = ensure_signed(origin)?; + ensure!(Self::pending_unlock(&signer).is_none(), Error::::PendingUnlock); ensure!(value >= T::Currency::minimum_balance(), Error::::InsufficientBond); let bond = Self::do_update_teerdays(&signer)?; let free_balance = T::Currency::free_balance(&signer);