mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-09 20:11:09 +00:00
Read locks once and not 2 times (#2394)
This commit is contained in:
@@ -711,9 +711,14 @@ where
|
||||
if locks.is_empty() {
|
||||
return Ok(())
|
||||
}
|
||||
|
||||
let now = <system::Module<T>>::block_number();
|
||||
if Self::locks(who).into_iter()
|
||||
.all(|l| now >= l.until || new_balance >= l.amount || !l.reasons.contains(reason))
|
||||
if locks.into_iter()
|
||||
.all(|l|
|
||||
now >= l.until
|
||||
|| new_balance >= l.amount
|
||||
|| !l.reasons.contains(reason)
|
||||
)
|
||||
{
|
||||
Ok(())
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user