From 7dc500a11d2892f59ecd7f3dc35972d31d86d027 Mon Sep 17 00:00:00 2001 From: ilgyu Date: Thu, 12 Dec 2024 15:56:31 +0900 Subject: [PATCH] fix: Fix bug for zero-transfer --- Lib9c/Delegation/Delegatee.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Lib9c/Delegation/Delegatee.cs b/Lib9c/Delegation/Delegatee.cs index 29c589c722..f2f51949e7 100644 --- a/Lib9c/Delegation/Delegatee.cs +++ b/Lib9c/Delegation/Delegatee.cs @@ -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);