mirror of
https://github.com/lightninglabs/pool.git
synced 2026-08-19 13:17:51 +02:00
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:
parent
ba9a223bd6
commit
42aec3fc8f
1 changed files with 14 additions and 1 deletions
15
rpcserver.go
15
rpcserver.go
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue