Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Actually respect locks of zero #14144

Merged
merged 6 commits into from
May 23, 2023
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions frame/balances/src/impl_currency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -846,17 +846,13 @@ where

type MaxLocks = T::MaxLocks;

// Set a lock on the balance of `who`.
// Is a no-op if lock amount is zero or `reasons` `is_none()`.
// Set or alter a lock on the balance of `who`.
fn set_lock(
id: LockIdentifier,
who: &T::AccountId,
amount: T::Balance,
reasons: WithdrawReasons,
) {
if amount.is_zero() || reasons.is_empty() {
return
}
let mut new_lock = Some(BalanceLock { id, amount, reasons: reasons.into() });
let mut locks = Self::locks(who)
.into_iter()
Expand Down