From f7baf7e29ec739d6e2d814de98003e01d9c75fdb Mon Sep 17 00:00:00 2001 From: jairajdev Date: Tue, 16 Apr 2024 23:38:45 +0545 Subject: [PATCH] Updated to skip updating accounts if the receipt is a challenge --- src/storage/receipt.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/storage/receipt.ts b/src/storage/receipt.ts index 7a04881..8158db4 100644 --- a/src/storage/receipt.ts +++ b/src/storage/receipt.ts @@ -83,6 +83,13 @@ export async function processReceiptData(receipts: Receipt[], saveOnlyNewData = let txReceipt: WrappedAccount = appReceiptData receiptsMap.set(tx.txId, tx.timestamp) + // If the receipt is a challenge, then skip updating its accounts data or transaction data + if ( + appliedReceipt && + appliedReceipt.confirmOrChallenge && + appliedReceipt.confirmOrChallenge.message === 'challenge' + ) + continue // Forward receipt data to LogServer if (config.enableCollectorSocketServer) await forwardReceiptData([receiptObj]) // Receipts size can be big, better to save per 100