From 3ef0074d33f657979e68806f9a73ac9259e19d98 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Thu, 31 Mar 2022 21:47:55 +0200 Subject: [PATCH] free not only the link value but also the decay amount withheld --- backend/src/util/validate.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/util/validate.ts b/backend/src/util/validate.ts index 3c8cd5935..8d1c90ca4 100644 --- a/backend/src/util/validate.ts +++ b/backend/src/util/validate.ts @@ -36,7 +36,7 @@ async function calculateBalance( // If we want to redeem a link we need to make sure that the link amount is not considered as blocked // else we cannot redeem links which are more or equal to half of what an account actually owns - const releasedLinkAmount = transactionLink ? transactionLink.amount : new Decimal(0) + const releasedLinkAmount = transactionLink ? transactionLink.holdAvailableAmount : new Decimal(0) if ( balance.minus(sumHoldAvailableAmount.toString()).plus(releasedLinkAmount.toString()).lessThan(0)