rpc: include order nonce in SidecarTicket

We add the order nonce as if automated negotiation was used, then the
order nonce (when it actually is submitted and its state) can be used to
track the ongoing sidecar ticket negotiation.
This commit is contained in:
Olaoluwa Osuntokun 2021-05-01 16:28:06 -07:00
parent ba9a223bd6
commit 42aec3fc8f
No known key found for this signature in database
GPG key ID: 3BBD59E99B280306

View file

@ -2324,6 +2324,17 @@ func (s *rpcServer) OfferSidecar(ctx context.Context,
return nil, err
}
var nonce order.Nonce
if bid != nil {
nonce = bid.Nonce()
}
// If the bid has already been specified, then we can go ahead and set
// it within the ticket.
ticket.Order = &sidecar.Order{
BidNonce: nonce,
}
// If the ticket has requested automated negotiation, then we'll hand
// it off to the coordinate tor now.
if ticket.Offer.Auto {
@ -2340,7 +2351,9 @@ func (s *rpcServer) OfferSidecar(ctx context.Context,
if err != nil {
return nil, err
}
return &poolrpc.SidecarTicket{Ticket: ticketStr}, nil
return &poolrpc.SidecarTicket{
Ticket: ticketStr,
}, nil
}
// RegisterSidecar is step 2/4 of the sidecar negotiation between the provider