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

Commit 728b107

Browse files
authored
Merge pull request #2028 from rodkeys/master
Added orderConfirmation state check
2 parents c1e7b23 + 191eb3c commit 728b107

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

net/service/handlers.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,14 @@ func (service *OpenBazaarService) handleOrderConfirmation(p peer.ID, pmes *pb.Me
553553
return nil, net.DuplicateMessage
554554
}
555555

556+
if state != pb.OrderState_PENDING {
557+
log.Debugf("order state (%s) is not what is expected", state.String())
558+
if err := service.SendProcessingError(p.Pretty(), vendorContract.VendorOrderConfirmation.OrderID, pb.Message_ORDER_CONFIRMATION, contract); err != nil {
559+
log.Errorf("failed sending ORDER_PROCESSING_FAILURE to peer (%s): %s", p.Pretty(), err)
560+
}
561+
return nil, net.OutOfOrderMessage
562+
}
563+
556564
// Validate the order confirmation
557565
log.Debugf("validating order confirmation message")
558566
err = service.node.ValidateOrderConfirmation(vendorContract, false)

0 commit comments

Comments
 (0)