From 9b89168c4974f969d65388b1c0e519973b68a3e0 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 30 Aug 2011 22:28:52 +0000 Subject: [PATCH] - validator: in "credit_from_wu" case, record what the new credit system would have assigned in result.claimed_credit. svn path=/trunk/boinc/; revision=24088 --- checkin_notes | 7 +++++++ sched/validator.cpp | 10 +++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/checkin_notes b/checkin_notes index 01e107d685..01c1e5af40 100644 --- a/checkin_notes +++ b/checkin_notes @@ -5320,3 +5320,10 @@ David 30 Aug 2011 samples/vboxwrapper/ vboxwrapper.cpp + +David 30 Aug 2011 + - validator: in "credit_from_wu" case, record what the new credit + system would have assigned in result.claimed_credit. + + sched/ + validator.cpp diff --git a/sched/validator.cpp b/sched/validator.cpp index adac0404cc..092b52abc5 100644 --- a/sched/validator.cpp +++ b/sched/validator.cpp @@ -149,7 +149,7 @@ int handle_wu( bool update_result, retry; TRANSITION_TIME transition_time = NO_CHANGE; int retval = 0, canonicalid = 0, x; - double credit = 0; + double credit = 0, credit_new = 0; unsigned int i; WORKUNIT& wu = items[0].wu; @@ -360,6 +360,7 @@ int handle_wu( wu, results, app, app_versions, host_app_versions, max_granted_credit, credit ); + retval = get_credit_from_wu(wu, results, credit); if (retval) { log_messages.printf(MSG_CRITICAL, @@ -437,6 +438,13 @@ int handle_wu( ); } result.granted_credit = credit; + if (credit_from_wu) { + DB_RESULT r; + r = result; + char buf[256]; + sprintf(buf, "claimed_credit=%f", credit_new); + r.update_field(buf); + } grant_credit(host, result.sent_time, credit); log_messages.printf(MSG_NORMAL, "[RESULT#%d %s] Valid; granted %f credit [HOST#%d]\n",