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

Commit e51a5b5

Browse files
committed
Strengthen condition to add disputeAcceptance
1 parent d01e377 commit e51a5b5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

wallet/listeners/transaction_listener.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ func (l *TransactionListener) OnTransactionReceived(cb wallet.TransactionCallbac
138138
log.Errorf("update funding for sale (%s): %s", orderId, err)
139139
}
140140
// This is a dispute payout. We should set the order state.
141-
if len(records) > 0 && fundsReleased {
142-
if contract.DisputeAcceptance == nil && contract != nil && contract.BuyerOrder != nil && contract.BuyerOrder.BuyerID != nil {
141+
if len(records) > 0 && fundsReleased && contract != nil && contract.Dispute != nil {
142+
if contract.DisputeAcceptance == nil && contract.BuyerOrder.BuyerID != nil {
143143
accept := new(pb.DisputeAcceptance)
144144
ts, _ := ptypes.TimestampProto(time.Now())
145145
accept.Timestamp = ts
@@ -178,8 +178,8 @@ func (l *TransactionListener) OnTransactionReceived(cb wallet.TransactionCallbac
178178
if err != nil {
179179
log.Errorf("update funding for purchase (%s): %s", orderId, err)
180180
}
181-
if len(records) > 0 && fundsReleased {
182-
if contract.DisputeAcceptance == nil && contract != nil && len(contract.VendorListings) > 0 && contract.VendorListings[0].VendorID != nil {
181+
if len(records) > 0 && fundsReleased && contract != nil && contract.Dispute != nil {
182+
if contract.DisputeAcceptance == nil && len(contract.VendorListings) > 0 && contract.VendorListings[0].VendorID != nil {
183183
accept := new(pb.DisputeAcceptance)
184184
ts, _ := ptypes.TimestampProto(time.Now())
185185
accept.Timestamp = ts

0 commit comments

Comments
 (0)