This commit is contained in:
Marcello Stanisci 2019-02-13 17:53:48 +01:00
parent e1ec7fc53c
commit bb44b9b475
No known key found for this signature in database
GPG Key ID: 8D526861953F4C0F
5 changed files with 38 additions and 17 deletions

View File

@ -140,7 +140,8 @@ history_cb (void *cls,
void
confirmation_cb (void *cls,
int success,
uint64_t serial_id,
const void *row_id,
size_t row_id_size,
const char *emsg)
{
if (GNUNET_YES != success)

View File

@ -1647,7 +1647,8 @@ prepare_cb (void *cls,
static void
wire_confirm_cb (void *cls,
int success,
uint64_t serial_id,
const void *row_id,
size_t row_id_size,
const char *emsg)
{
struct TALER_EXCHANGEDB_Session *session = wpd->session;

View File

@ -148,10 +148,10 @@ struct TALER_WIRE_HistoryHandle;
typedef void
(*TALER_WIRE_ConfirmationCallback)(void *cls,
int success,
uint64_t serial_id,
const void *row_id,
size_t row_id_size,
const char *emsg);
/**
* @brief The plugin API, returned from the plugin's "init" function.
* The argument given to "init" is simply a configuration handle.

View File

@ -632,6 +632,7 @@ execute_cb (void *cls,
json_t *reason;
const char *emsg;
char *s;
uint64_t serial_id_nbo;
eh->aaih = NULL;
emsg = NULL;
@ -653,10 +654,15 @@ execute_cb (void *cls,
"%u/%u",
http_status,
(unsigned int) ec);
serial_id_nbo = GNUNET_htonll (serial_id);
eh->cc (eh->cc_cls,
(MHD_HTTP_OK == http_status) ? GNUNET_OK : GNUNET_SYSERR,
serial_id,
&serial_id_nbo,
sizeof (uint64_t),
(MHD_HTTP_OK == http_status) ? NULL : s);
GNUNET_free (s);
GNUNET_free (eh);
}

View File

@ -153,18 +153,21 @@ timeout_cb (void *cls)
* @param cls closure
* @param ec taler status code
* @param dir direction of the transfer
* @param row_off identification of the position at which we are querying
* @param row_off identification of the position at
* which we are querying
* @param row_off_size number of bytes in @a row_off
* @param details details about the wire transfer
* @return #GNUNET_OK to continue, #GNUNET_SYSERR to abort iteration
* @return #GNUNET_OK to continue, #GNUNET_SYSERR to
* abort iteration
*/
static int
history_result_cb (void *cls,
enum TALER_ErrorCode ec,
enum TALER_BANK_Direction dir,
const void *row_off,
size_t row_off_size,
const struct TALER_WIRE_TransferDetails *details)
history_result_cb
(void *cls,
enum TALER_ErrorCode ec,
enum TALER_BANK_Direction dir,
const void *row_off,
size_t row_off_size,
const struct TALER_WIRE_TransferDetails *details)
{
uint64_t *serialp;
uint64_t serialh;
@ -222,16 +225,20 @@ history_result_cb (void *cls,
* Function called with the result from the execute step.
*
* @param cls closure
* @param success #GNUNET_OK on success, #GNUNET_SYSERR on failure
* @param serial_id unique ID of the wire transfer in the bank's records; UINT64_MAX on error
* @param success #GNUNET_OK on success,
* #GNUNET_SYSERR on failure
* @param row_id ID of the fresh transaction,
* in _network_ byte order.
* @param emsg NULL on success, otherwise an error message
*/
static void
confirmation_cb (void *cls,
int success,
uint64_t serial_id,
const void *row_id,
size_t row_id_size,
const char *emsg)
{
uint64_t tmp;
eh = NULL;
if (GNUNET_OK != success)
{
@ -240,7 +247,13 @@ confirmation_cb (void *cls,
GNUNET_SCHEDULER_shutdown ();
return;
}
serial_target = serial_id;
memcpy (&tmp,
row_id,
row_id_size);
serial_target = GNUNET_ntohll (tmp);
hh = plugin->get_history (plugin->cls,
my_account,
TALER_BANK_DIRECTION_BOTH,