From cc30a605c97c713791454b5c11ffc2e61625e17f Mon Sep 17 00:00:00 2001 From: "nieznany.sprawiciel" Date: Fri, 26 Jul 2024 12:22:39 +0200 Subject: [PATCH] Set status to Settled after task is closed, not before --- Golem/Job.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Golem/Job.cs b/Golem/Job.cs index 41f5284..d306653 100644 --- a/Golem/Job.cs +++ b/Golem/Job.cs @@ -117,6 +117,7 @@ public bool Active } } + public bool IsClosed { get => !Active; } public void UpdateActivityState(ActivityStatePair activityState) { @@ -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); }