add api to allow clients to force auditor notification of dc
This commit is contained in:
parent
c1ce2a03ed
commit
47e4dc13ed
@ -770,6 +770,16 @@ TALER_EXCHANGE_deposit (struct TALER_EXCHANGE_Handle *exchange,
|
|||||||
void *cb_cls);
|
void *cb_cls);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Change the chance that our deposit confirmation will be given to the
|
||||||
|
* auditor to 100%.
|
||||||
|
*
|
||||||
|
* @param deposit the deposit permission request handle
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
TALER_EXCHANGE_deposit_force_dc (struct TALER_EXCHANGE_DepositHandle *deposit);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cancel a deposit permission request. This function cannot be used
|
* Cancel a deposit permission request. This function cannot be used
|
||||||
* on a request handle if a response is already served for it.
|
* on a request handle if a response is already served for it.
|
||||||
|
@ -105,6 +105,12 @@ struct TALER_EXCHANGE_DepositHandle
|
|||||||
*/
|
*/
|
||||||
struct TALER_Amount coin_value;
|
struct TALER_Amount coin_value;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Chance that we will inform the auditor about the deposit
|
||||||
|
* is 1:n, where the value of this field is "n".
|
||||||
|
*/
|
||||||
|
unsigned int auditor_chance;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -129,7 +135,7 @@ auditor_cb (void *cls,
|
|||||||
struct TEAH_AuditorInteractionEntry *aie;
|
struct TEAH_AuditorInteractionEntry *aie;
|
||||||
|
|
||||||
if (0 != GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK,
|
if (0 != GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK,
|
||||||
AUDITOR_CHANCE))
|
dh->auditor_chance))
|
||||||
return NULL;
|
return NULL;
|
||||||
key_state = TALER_EXCHANGE_get_keys (dh->exchange);
|
key_state = TALER_EXCHANGE_get_keys (dh->exchange);
|
||||||
spk = TALER_EXCHANGE_get_signing_key_details (key_state,
|
spk = TALER_EXCHANGE_get_signing_key_details (key_state,
|
||||||
@ -573,6 +579,7 @@ TALER_EXCHANGE_deposit (struct TALER_EXCHANGE_Handle *exchange,
|
|||||||
}
|
}
|
||||||
|
|
||||||
dh = GNUNET_new (struct TALER_EXCHANGE_DepositHandle);
|
dh = GNUNET_new (struct TALER_EXCHANGE_DepositHandle);
|
||||||
|
dh->auditor_chance = AUDITOR_CHANCE;
|
||||||
dh->exchange = exchange;
|
dh->exchange = exchange;
|
||||||
dh->cb = cb;
|
dh->cb = cb;
|
||||||
dh->cb_cls = cb_cls;
|
dh->cb_cls = cb_cls;
|
||||||
@ -619,6 +626,19 @@ TALER_EXCHANGE_deposit (struct TALER_EXCHANGE_Handle *exchange,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Change the chance that our deposit confirmation will be given to the
|
||||||
|
* auditor to 100%.
|
||||||
|
*
|
||||||
|
* @param deposit the deposit permission request handle
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
TALER_EXCHANGE_deposit_force_dc (struct TALER_EXCHANGE_DepositHandle *deposit)
|
||||||
|
{
|
||||||
|
deposit->auditor_chance = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cancel a deposit permission request. This function cannot be used
|
* Cancel a deposit permission request. This function cannot be used
|
||||||
* on a request handle if a response is already served for it.
|
* on a request handle if a response is already served for it.
|
||||||
|
Loading…
Reference in New Issue
Block a user