Skip to content

Commit

Permalink
Set status to Settled after task is closed, not before
Browse files Browse the repository at this point in the history
  • Loading branch information
nieznanysprawiciel committed Jul 26, 2024
1 parent 87de05e commit cc30a60
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion 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,7 +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 (this.CurrentReward == confirmedSum)
if (this.IsClosed && this.CurrentReward == confirmedSum)
{
return IntoPaymentStatus(InvoiceStatus.SETTLED);
}
Expand Down

0 comments on commit cc30a60

Please sign in to comment.