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

Commit de8d0fb

Browse files
authored
Merge pull request #2054 from OpenBazaar/brian.notification-fixes
Fix for orders that have dispute acceptance but fulfilled state still
2 parents 0a3ccbd + 06a51fd commit de8d0fb

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

wallet/listeners/transaction_listener.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,18 @@ func (l *TransactionListener) cleanupOrderState(isSale bool, contract *pb.Ricard
7575
log.Errorf("Error saving new order state: %s", err)
7676
}
7777
}
78+
79+
if contract.DisputeAcceptance != nil && state == pb.OrderState_FULFILLED {
80+
log.Infof("Out of sync order. Found %s and should be %s\n", state, pb.OrderState_DECIDED)
81+
if isSale {
82+
err = l.db.Sales().Put(orderId, *contract, pb.OrderState_DECIDED, false)
83+
} else {
84+
err = l.db.Purchases().Put(orderId, *contract, pb.OrderState_DECIDED, false)
85+
}
86+
if err != nil {
87+
log.Errorf("Error saving new order state: %s", err)
88+
}
89+
}
7890
}
7991

8092
func (l *TransactionListener) OnTransactionReceived(cb wallet.TransactionCallback) {

0 commit comments

Comments
 (0)