Skip to content

Commit

Permalink
Fix committe issue (#2707)
Browse files Browse the repository at this point in the history
  • Loading branch information
shargon authored Apr 28, 2022
1 parent d76b800 commit 17656ce
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/neo/SmartContract/Native/NeoToken.cs
Original file line number Diff line number Diff line change
Expand Up @@ -340,11 +340,12 @@ private async ContractTask<bool> Vote(ApplicationEngine engine, UInt160 account,
public (ECPoint PublicKey, BigInteger Votes)[] GetCandidates(DataCache snapshot)
{
byte[] prefix_key = CreateStorageKey(Prefix_Candidate).ToArray();
return snapshot.Find(prefix_key).Select(p =>
(
p.Key.Key.AsSerializable<ECPoint>(1),
p.Value.GetInteroperable<CandidateState>()
)).Where(p => p.Item2.Registered).Select(p => (p.Item1, p.Item2.Votes)).ToArray();
return snapshot.Find(prefix_key)
.Select(p => (p.Key.Key.AsSerializable<ECPoint>(1), p.Value.GetInteroperable<CandidateState>()))
.Where(p => p.Item2.Registered)
.Where(p => !Policy.IsBlocked(snapshot, Contract.CreateSignatureRedeemScript(p.Item1).ToScriptHash()))
.Select(p => (p.Item1, p.Item2.Votes))
.ToArray();
}

/// <summary>
Expand Down Expand Up @@ -407,7 +408,6 @@ public ECPoint[] ComputeNextBlockValidators(DataCache snapshot, ProtocolSettings
return candidates
.OrderByDescending(p => p.Votes)
.ThenBy(p => p.PublicKey)
.Where(p => !Policy.IsBlocked(snapshot, Contract.CreateSignatureRedeemScript(p.PublicKey).ToScriptHash()))
.Take(settings.CommitteeMembersCount);
}

Expand Down

0 comments on commit 17656ce

Please sign in to comment.