Skip to content

Commit

Permalink
optimize batch delist
Browse files Browse the repository at this point in the history
  • Loading branch information
fyannch committed Jul 9, 2024
1 parent 30a5cbd commit 031f51b
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions contract/Forest/ForestContract_Sellers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,22 @@ private Empty SingleDelist(DelistInput input)
}

Assert(input.Price != null, "Need to specific list record.");
var listedNftInfo = listedNftInfoList.Value.FirstOrDefault(i =>
ListedNFTInfo listedNftInfo = null;
/*listedNftInfoList.Value.FirstOrDefault(i =>
i.Price.Amount == input.Price.Amount && i.Price.Symbol == input.Price.Symbol &&
i.Owner == Context.Sender &&
(input.StartTime == null ? true : input.StartTime.Seconds == i.Duration.StartTime.Seconds));
(input.StartTime == null ? true : input.StartTime.Seconds == i.Duration.StartTime.Seconds));*/

foreach (var i in listedNftInfoList.Value)
{
if (i.Price.Amount == input.Price.Amount && i.Price.Symbol == input.Price.Symbol &&
i.Owner == Context.Sender &&
(input.StartTime == null ? true : input.StartTime.Seconds == i.Duration.StartTime.Seconds))
{
listedNftInfo = i;
break;
}
}

if (listedNftInfo == null)
{
Expand Down

0 comments on commit 031f51b

Please sign in to comment.