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

Commit d537582

Browse files
committed
Only move to RESOLVED state if dispute acceptance is there
1 parent 7e4e96c commit d537582

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

wallet/listeners/transaction_listener.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,16 @@ func (l *TransactionListener) getOrderDetails(orderID string, address btc.Addres
5656
}
5757

5858
// cleanupOrderState - scan each order to ensure the state in the db matches the state of the contract stored
59-
func (l *TransactionListener) cleanupOrderState(isSale bool, txid string, output wallet.TransactionOutput, contract *pb.RicardianContract, state pb.OrderState, funded bool, records []*wallet.TransactionRecord) {
59+
func (l *TransactionListener) cleanupOrderState(isSale bool, txid string, output wallet.TransactionOutput, contract *pb.RicardianContract, state pb.OrderState, funded bool, records []*wallet.TransactionRecord) {
6060

6161
orderId, err := calcOrderId(contract.BuyerOrder)
6262
if err != nil {
6363
return
6464
}
6565
log.Debugf("Cleaning up order state for: #%s\n", orderId)
6666

67-
if contract.DisputeResolution != nil && state != pb.OrderState_RESOLVED {
68-
log.Infof("Out of sync order. Found %s and should be %s\n", state, pb.OrderState_RESOLVED)
67+
if contract.DisputeResolution != nil && state != pb.OrderState_DECIDED && state != pb.OrderState_RESOLVED {
68+
log.Infof("Out of sync order. Found %s and should either DECIDED be %s\n", state, pb.OrderState_RESOLVED)
6969
if isSale {
7070
l.db.Sales().Put(orderId, *contract, pb.OrderState_RESOLVED, false)
7171
} else {

0 commit comments

Comments
 (0)