diff --git a/src/neo/SmartContract/Native/NeoToken.cs b/src/neo/SmartContract/Native/NeoToken.cs index f47a37637b..19cd893619 100644 --- a/src/neo/SmartContract/Native/NeoToken.cs +++ b/src/neo/SmartContract/Native/NeoToken.cs @@ -340,11 +340,12 @@ private async ContractTask 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(1), - p.Value.GetInteroperable() - )).Where(p => p.Item2.Registered).Select(p => (p.Item1, p.Item2.Votes)).ToArray(); + return snapshot.Find(prefix_key) + .Select(p => (p.Key.Key.AsSerializable(1), p.Value.GetInteroperable())) + .Where(p => p.Item2.Registered) + .Where(p => !Policy.IsBlocked(snapshot, Contract.CreateSignatureRedeemScript(p.Item1).ToScriptHash())) + .Select(p => (p.Item1, p.Item2.Votes)) + .ToArray(); } /// @@ -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); }