Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set payment status to Settled always when Job is paid #188

Merged
merged 3 commits into from
Jul 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Golem/Job.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ public bool Active
}
}

public bool IsClosed { get => !Active; }

public void UpdateActivityState(ActivityStatePair activityState)
{
Expand Down Expand Up @@ -214,8 +215,7 @@ public static JobStatus ResolveTerminationReason(string? code)
Logger.LogInformation($"Job: {this.Id}, confirmed sum: {confirmedSum}, job expected reward: {this.CurrentReward}");

// Workaround for yagna unable to change status to SETTLED when using partial payments
if (suggestedPaymentStatus == GolemLib.Types.PaymentStatus.Accepted
&& this.CurrentReward == confirmedSum)
if (this.IsClosed && this.CurrentReward == confirmedSum)
{
return IntoPaymentStatus(InvoiceStatus.SETTLED);
}
Expand Down
Loading