aboutsummaryrefslogtreecommitdiff
path: root/src/testing/testing_api_cmd_reserve_status.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testing/testing_api_cmd_reserve_status.c')
-rw-r--r--src/testing/testing_api_cmd_reserve_status.c52
1 files changed, 29 insertions, 23 deletions
diff --git a/src/testing/testing_api_cmd_reserve_status.c b/src/testing/testing_api_cmd_reserve_status.c
index 1d104cc3e..9abd99f0b 100644
--- a/src/testing/testing_api_cmd_reserve_status.c
+++ b/src/testing/testing_api_cmd_reserve_status.c
@@ -126,7 +126,6 @@ analyze_command (const struct TALER_ReservePublicKeyP *reserve_pub,
else
{
const struct TALER_ReservePublicKeyP *rp;
- const struct TALER_EXCHANGE_ReserveHistoryEntry *he;
if (GNUNET_OK !=
TALER_TESTING_get_trait_reserve_pub (cmd,
@@ -136,32 +135,39 @@ analyze_command (const struct TALER_ReservePublicKeyP *reserve_pub,
GNUNET_memcmp (rp,
reserve_pub))
return GNUNET_OK; /* command affects some _other_ reserve */
- if (GNUNET_OK !=
- TALER_TESTING_get_trait_reserve_history (cmd,
- &he))
- {
- /* NOTE: only for debugging... */
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Command `%s' has the reserve_pub trait, but does not reserve history trait\n",
- cmd->label);
- return GNUNET_OK; /* command does nothing for reserves */
- }
- for (unsigned int i = 0; i<history_length; i++)
+ for (unsigned int j = 0; true; j++)
{
- if (found[i])
- continue; /* already found, skip */
- if (0 ==
- TALER_TESTING_history_entry_cmp (he,
- &history[i]))
+ const struct TALER_EXCHANGE_ReserveHistoryEntry *he;
+
+ if (GNUNET_OK !=
+ TALER_TESTING_get_trait_reserve_history (cmd,
+ j,
+ &he))
{
- found[i] = GNUNET_YES;
- return GNUNET_OK;
+ /* NOTE: only for debugging... */
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Command `%s' has the reserve_pub trait, but does not reserve history trait\n",
+ cmd->label);
+ return GNUNET_OK; /* command does nothing for reserves */
+ }
+ for (unsigned int i = 0; i<history_length; i++)
+ {
+ if (found[i])
+ continue; /* already found, skip */
+ if (0 ==
+ TALER_TESTING_history_entry_cmp (he,
+ &history[i]))
+ {
+ found[i] = true;
+ return GNUNET_OK;
+ }
}
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Command `%s' reserve history entry #%u not found\n",
+ cmd->label,
+ j);
+ return GNUNET_SYSERR;
}
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Command `%s' reserve history entry not found\n",
- cmd->label);
- return GNUNET_SYSERR;
}
}