This commit is contained in:
Christian Grothoff 2015-07-05 13:18:49 +02:00
parent 7d8783dee3
commit dde1ff8821
4 changed files with 13 additions and 6 deletions

View File

@ -169,6 +169,9 @@ TALER_amount_ntoh (struct TALER_Amount *res,
* @param a1 first amount * @param a1 first amount
* @param a2 second amount * @param a2 second amount
* @return result of the comparison * @return result of the comparison
* -1 if `a1 < a2`
* 1 if `a1 > a2`
* 0 if `a1 == a2`.
*/ */
int int
TALER_amount_cmp (const struct TALER_Amount *a1, TALER_amount_cmp (const struct TALER_Amount *a1,

View File

@ -655,7 +655,7 @@ withdraw_sign_ok (struct TALER_MINT_WithdrawSignHandle *wsh,
struct GNUNET_CRYPTO_rsa_Signature *sig; struct GNUNET_CRYPTO_rsa_Signature *sig;
struct TALER_DenominationSignature dsig; struct TALER_DenominationSignature dsig;
struct MAJ_Specification spec[] = { struct MAJ_Specification spec[] = {
MAJ_spec_fixed_auto ("ev_sig", &blind_sig), MAJ_spec_rsa_signature ("ev_sig", &blind_sig),
MAJ_spec_end MAJ_spec_end
}; };
@ -771,10 +771,10 @@ withdraw_sign_payment_required (struct TALER_MINT_WithdrawSignHandle *wsh,
return GNUNET_SYSERR; return GNUNET_SYSERR;
} }
/* Check that funds were really insufficient */ /* Check that funds were really insufficient */
if (0 < TALER_amount_cmp (&requested_amount, if (0 >= TALER_amount_cmp (&requested_amount,
&balance)) &balance))
{ {
/* Requested amount is smaller than reported balance, /* Requested amount is smaller or equal to reported balance,
so this should not have failed. */ so this should not have failed. */
GNUNET_break_op (0); GNUNET_break_op (0);
return GNUNET_SYSERR; return GNUNET_SYSERR;
@ -971,6 +971,7 @@ TALER_MINT_withdraw_sign (struct TALER_MINT_Handle *mint,
wsh->mint = mint; wsh->mint = mint;
wsh->cb = res_cb; wsh->cb = res_cb;
wsh->cb_cls = res_cb_cls; wsh->cb_cls = res_cb_cls;
wsh->pk = pk;
GNUNET_CRYPTO_eddsa_key_get_public (&coin_priv->eddsa_priv, GNUNET_CRYPTO_eddsa_key_get_public (&coin_priv->eddsa_priv,
&coin_pub.eddsa_pub); &coin_pub.eddsa_pub);

View File

@ -819,7 +819,7 @@ run (void *cls,
{ .oc = OC_ADMIN_ADD_INCOMING, { .oc = OC_ADMIN_ADD_INCOMING,
.label = "create-reserve-1", .label = "create-reserve-1",
.details.admin_add_incoming.wire = "{ \"bank\":\"source bank\", \"account\":42 }", .details.admin_add_incoming.wire = "{ \"bank\":\"source bank\", \"account\":42 }",
.details.admin_add_incoming.amount = "EUR:5" }, .details.admin_add_incoming.amount = "EUR:5.01" },
{ .oc = OC_WITHDRAW_SIGN, { .oc = OC_WITHDRAW_SIGN,
.label = "withdraw-coin-1", .label = "withdraw-coin-1",
.details.withdraw_sign.reserve_reference = "create-reserve-1", .details.withdraw_sign.reserve_reference = "create-reserve-1",

View File

@ -305,7 +305,10 @@ TALER_amount_cmp_currency_nbo (const struct TALER_AmountNBO *a1,
* *
* @param a1 first amount * @param a1 first amount
* @param a2 second amount * @param a2 second amount
* @return result of the comparison * @return result of the comparison,
* -1 if `a1 < a2`
* 1 if `a1 > a2`
* 0 if `a1 == a2`.
*/ */
int int
TALER_amount_cmp (const struct TALER_Amount *a1, TALER_amount_cmp (const struct TALER_Amount *a1,