Skip to content
This repository has been archived by the owner on Mar 28, 2023. It is now read-only.

Commit

Permalink
Fix disputed but accepted out of sync orders
Browse files Browse the repository at this point in the history
  • Loading branch information
hoffmabc committed Apr 21, 2020
1 parent de8d0fb commit 2dacc0f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions wallet/listeners/transaction_listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ func (l *TransactionListener) cleanupOrderState(isSale bool, contract *pb.Ricard
}
}

if contract.DisputeAcceptance != nil && state == pb.OrderState_FULFILLED {
log.Infof("Out of sync order. Found %s and should be %s\n", state, pb.OrderState_DECIDED)
if contract.DisputeAcceptance != nil && state == pb.OrderState_DISPUTED {
log.Infof("Out of sync order. Found %s and should be %s\n", state, pb.OrderState_RESOLVED)
if isSale {
err = l.db.Sales().Put(orderId, *contract, pb.OrderState_DECIDED, false)
err = l.db.Sales().Put(orderId, *contract, pb.OrderState_RESOLVED, false)
} else {
err = l.db.Purchases().Put(orderId, *contract, pb.OrderState_DECIDED, false)
err = l.db.Purchases().Put(orderId, *contract, pb.OrderState_RESOLVED, false)
}
if err != nil {
log.Errorf("Error saving new order state: %s", err)
Expand Down

0 comments on commit 2dacc0f

Please sign in to comment.