Skip to content

Commit

Permalink
Short circuit PosBase::transfer if amount is zero
Browse files Browse the repository at this point in the history
  • Loading branch information
james-chf committed Dec 1, 2022
1 parent cf49c17 commit ac057b1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions proof_of_stake/src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,9 @@ where
src: &namada_core::types::address::Address,
dest: &namada_core::types::address::Address,
) {
if amount.is_zero() {
return;
}
let src_key = token::balance_key(token, src);
let dest_key = token::balance_key(token, dest);
if let (Some(src_balance), _gas) = self
Expand Down

0 comments on commit ac057b1

Please sign in to comment.