@@ -524,7 +524,7 @@ func (n *OpenBazaarNode) SendOrderCompletion(peerID string, k *libp2p.PubKey, co
524
524
}
525
525
526
526
// SendDisputeOpen - send open dispute msg to peer
527
- func (n * OpenBazaarNode ) SendDisputeOpen (peerID string , k * libp2p.PubKey , disputeMessage * pb.RicardianContract ) error {
527
+ func (n * OpenBazaarNode ) SendDisputeOpen (peerID string , k * libp2p.PubKey , disputeMessage * pb.RicardianContract , orderID string ) error {
528
528
a , err := ptypes .MarshalAny (disputeMessage )
529
529
if err != nil {
530
530
log .Errorf ("failed to marshal the contract: %v" , err )
@@ -538,19 +538,16 @@ func (n *OpenBazaarNode) SendDisputeOpen(peerID string, k *libp2p.PubKey, disput
538
538
}
539
539
540
540
// Save DISPUTE_OPEN message to the database for this order for resending if necessary
541
- var orderID0 string
542
- if disputeMessage .VendorOrderConfirmation != nil {
543
- orderID0 = disputeMessage .VendorOrderConfirmation .OrderID
544
- if orderID0 == "" {
545
- log .Errorf ("failed fetching orderID" )
546
- } else {
541
+ orderID0 := orderID
542
+ if orderID0 == "" {
543
+ log .Errorf ("failed fetching orderID" )
544
+ } else {
547
545
err = n .Datastore .Messages ().Put (
548
546
fmt .Sprintf ("%s-%d" , orderID0 , int (pb .Message_DISPUTE_OPEN )),
549
547
orderID0 , pb .Message_DISPUTE_OPEN , peerID , repo.Message {Msg : m },
550
548
"" , 0 , []byte {})
551
549
if err != nil {
552
- log .Errorf ("failed putting message (%s-%d): %v" , orderID0 , int (pb .Message_DISPUTE_OPEN ), err )
553
- }
550
+ log .Errorf ("failed putting message (%s-%d): %v" , orderID0 , int (pb .Message_DISPUTE_OPEN ), err )
554
551
}
555
552
}
556
553
0 commit comments