wallet-core: fix withdrawal of age-restricted denoms without age restriction
This commit is contained in:
parent
ec43b6a5bf
commit
9fe0e74256
@ -674,16 +674,17 @@ 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) {
|
if (req.restrictAge || denomPub.age_mask) {
|
||||||
if (denomPub.age_mask === 0) {
|
if (req.restrictAge && denomPub.age_mask === 0) {
|
||||||
throw Error(
|
throw Error(
|
||||||
"requested age restriction for a denomination that does not support age restriction",
|
"requested age restriction for a denomination that does not support age restriction",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
logger.info("creating age-restricted planchet");
|
const age = req.restrictAge || 32;
|
||||||
|
logger.info(`creating age-restricted planchet (age ${age})`);
|
||||||
maybeAcp = await AgeRestriction.restrictionCommit(
|
maybeAcp = await AgeRestriction.restrictionCommit(
|
||||||
denomPub.age_mask,
|
denomPub.age_mask,
|
||||||
req.restrictAge,
|
age,
|
||||||
);
|
);
|
||||||
maybeAgeCommitmentHash = AgeRestriction.hashCommitment(
|
maybeAgeCommitmentHash = AgeRestriction.hashCommitment(
|
||||||
maybeAcp.commitment,
|
maybeAcp.commitment,
|
||||||
|
Loading…
Reference in New Issue
Block a user