Best only on elected (#3007)

This commit is contained in:
Jaco Greeff 2020-06-20 21:12:44 +02:00 committed by GitHub
parent fa107fe74f
commit 26318a2d8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -31,9 +31,9 @@ interface Selected {
}
function autoPick (targets: SortedTargets): string[] {
return (targets.validators || []).reduce((result: string[], { key, numNominators, rewardPayout }): string[] => {
return (targets.validators || []).reduce((result: string[], { isElected, isFavorite, key, numNominators, rewardPayout }): string[] => {
if (result.length < MAX_NOMINATIONS) {
if (numNominators && (numNominators < MAX_PAYOUTS) && !rewardPayout.isZero()) {
if (numNominators && (numNominators < MAX_PAYOUTS) && (isElected || isFavorite) && !rewardPayout.isZero()) {
result.push(key);
}
}

View File

@ -81,8 +81,8 @@ function Targets ({ className = '', ownStashes, targets: { calcWith, lastReward,
const _selectProfitable = useCallback(
() => setSelected(
(validators || []).reduce((result: string[], { hasIdentity, key, rewardPayout }): string[] => {
if ((result.length < MAX_NOMINATIONS) && (withoutName || hasIdentity) && !rewardPayout.isZero()) {
(validators || []).reduce((result: string[], { hasIdentity, isElected, isFavorite, key, rewardPayout }): string[] => {
if ((result.length < MAX_NOMINATIONS) && (withoutName || hasIdentity) && (isElected || isFavorite) && !rewardPayout.isZero()) {
result.push(key);
}