Skip to content

Commit

Permalink
Updated to skip updating accounts if the receipt is a challenge
Browse files Browse the repository at this point in the history
  • Loading branch information
jairajdev committed Apr 16, 2024
1 parent 64341c0 commit f7baf7e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/storage/receipt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f7baf7e

Please sign in to comment.