From 1b2ae4e9f543d039a56934332b946fc853703d4e Mon Sep 17 00:00:00 2001
From: Piotr Roslaniec
Date: Tue, 27 Jun 2023 18:46:23 +0200
Subject: [PATCH] apply pr suggestions, part 2
---
src/characters/cbd-recipient.ts | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/characters/cbd-recipient.ts b/src/characters/cbd-recipient.ts
index 4c32f3b2d..8a97e2eda 100644
--- a/src/characters/cbd-recipient.ts
+++ b/src/characters/cbd-recipient.ts
@@ -96,12 +96,12 @@ export class CbdTDecDecrypter {
encryptedRequests,
this.threshold
);
-
- if (Object.keys(errors).length > 0) {
+ if (Object.keys(encryptedResponses).length < this.threshold) {
throw new Error(
`CBD decryption failed with errors: ${JSON.stringify(errors)}`
);
}
+
return this.makeDecryptionShares(
encryptedResponses,
sharedSecrets,