Skip to content

Commit

Permalink
Merge pull request #188 from golemfactory/status-settled-always-when-…
Browse files Browse the repository at this point in the history
…paid

Set payment status to Settled always when Job is paid
  • Loading branch information
nieznanysprawiciel authored Jul 26, 2024
2 parents 13ce2d5 + cc30a60 commit 3810d9c
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit 3810d9c

Please sign in to comment.