wallet-core: fix mixed age restrictions
This commit is contained in:
parent
117baf0e5b
commit
4b72bbd017
@ -675,13 +675,8 @@ export const nativeCryptoR: TalerCryptoInterfaceR = {
|
|||||||
|
|
||||||
let maybeAcp: AgeCommitmentProof | undefined = undefined;
|
let maybeAcp: AgeCommitmentProof | undefined = undefined;
|
||||||
let maybeAgeCommitmentHash: string | undefined = undefined;
|
let maybeAgeCommitmentHash: string | undefined = undefined;
|
||||||
if (req.restrictAge || denomPub.age_mask) {
|
if (denomPub.age_mask) {
|
||||||
if (req.restrictAge && denomPub.age_mask === 0) {
|
const age = req.restrictAge || AgeRestriction.AGE_UNRESTRICTED;
|
||||||
throw Error(
|
|
||||||
"requested age restriction for a denomination that does not support age restriction",
|
|
||||||
);
|
|
||||||
}
|
|
||||||
const age = req.restrictAge || 32;
|
|
||||||
logger.info(`creating age-restricted planchet (age ${age})`);
|
logger.info(`creating age-restricted planchet (age ${age})`);
|
||||||
maybeAcp = await AgeRestriction.restrictionCommit(
|
maybeAcp = await AgeRestriction.restrictionCommit(
|
||||||
denomPub.age_mask,
|
denomPub.age_mask,
|
||||||
|
Loading…
Reference in New Issue
Block a user