Skip to content

Commit

Permalink
fix: Fix bug for zero-transfer
Browse files Browse the repository at this point in the history
  • Loading branch information
OnedgeLee committed Dec 12, 2024
1 parent 25b17cb commit 7dc500a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Lib9c/Delegation/Delegatee.cs
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,11 @@ record = Repository.GetLumpSumRewardsRecord(this, lastStartHeight)
rewardBase = rewardBase.AddRewards(recordEach.LumpSumRewards.Values);
foreach (var r in recordEach.LumpSumRewards)
{
Repository.TransferAsset(recordEach.Address, DistributionPoolAddress(), Repository.GetBalance(recordEach.Address, r.Key));
var toTransfer = Repository.GetBalance(recordEach.Address, r.Key);
if (toTransfer.Sign > 0)
{
Repository.TransferAsset(RewardPoolAddress, DistributionPoolAddress(), toTransfer);
}
}

Repository.RemoveLumpSumRewardsRecord(recordEach);
Expand Down

0 comments on commit 7dc500a

Please sign in to comment.