Skip to content

Commit

Permalink
Redeem the invalid commitment right the after reward transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
fatemeh-ra committed Oct 22, 2024
1 parent 389a724 commit 6d07ae9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/brown-games-drop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rosen-bridge/watcher': patch
---

Fix redeem job to redeem the invalid commitment right the after reward transaction
3 changes: 2 additions & 1 deletion src/utils/watcherUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ class WatcherUtils {
* 1 - Not triggered after the specified period
* 2 - Created after the related trigger
* 3 - It's a duplicate commitment and a valid one merged to create the trigger (WID exists in trigger)
* 4 - It's information is not valid and trigger was spent without rewarding the commitment
* @param commitment
* @returns true if the commitment is still valid and false otherwise
*/
Expand All @@ -405,7 +406,7 @@ class WatcherUtils {
commitment.eventId
);

if (eventTrigger == null) {
if (eventTrigger == null || eventTrigger.spendBlock !== undefined) {
return false;
}

Expand Down

0 comments on commit 6d07ae9

Please sign in to comment.