diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-08-15 20:26:03 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-08-15 20:26:03 +0200 |
commit | b1050243eb02e424f55c3d6c78787a47944c8f33 (patch) | |
tree | ab085b6be4c26bd65febdd3ee3968f95734e6993 /src/bank-lib | |
parent | f76f645732d97aee4d7cc4b9fae44bdbd6ec57be (diff) |
-more work on extended fakebank API
Diffstat (limited to 'src/bank-lib')
-rw-r--r-- | src/bank-lib/fakebank.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/bank-lib/fakebank.c b/src/bank-lib/fakebank.c index 2f1d7868e..5c323b5d0 100644 --- a/src/bank-lib/fakebank.c +++ b/src/bank-lib/fakebank.c @@ -2739,13 +2739,19 @@ do_post_withdrawal (struct TALER_FAKEBANK_Handle *h, TALER_EC_BANK_WITHDRAWAL_OPERATION_RESERVE_SELECTION_CONFLICT, NULL); } - // FIXME: check if reserve_pub is known. If so: - if (0) { - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_CONFLICT, - TALER_EC_BANK_DUPLICATE_RESERVE_PUB_SUBJECT, - NULL); + /* check if reserve_pub is already in use */ + const struct GNUNET_PeerIdentity *pid; + + pid = (const struct GNUNET_PeerIdentity *) &wo->reserve_pub; + if (GNUNET_CONTAINER_multipeermap_contains (h->rpubs, + pid)) + { + return TALER_MHD_reply_with_error (connection, + MHD_HTTP_CONFLICT, + TALER_EC_BANK_DUPLICATE_RESERVE_PUB_SUBJECT, + NULL); + } } wo->reserve_pub = *reserve_pub; GNUNET_free (wo->exchange_account); // FIXME: or conflict if changed? |