@@ -21,6 +21,7 @@ import (
21
21
"github.com/decred/dcrd/wire"
22
22
"github.com/decred/slog"
23
23
vspd "github.com/decred/vspd/client/v4"
24
+ "github.com/decred/vspd/types/v3"
24
25
)
25
26
26
27
type DialFunc func (ctx context.Context , network , addr string ) (net.Conn , error )
@@ -139,18 +140,29 @@ func (c *VSPClient) ProcessManagedTickets(ctx context.Context, tickets []*VSPTic
139
140
_ , ok := c .jobs [* hash ]
140
141
c .mu .Unlock ()
141
142
if ok {
143
+ c .log .Debugf ("Ticket %s already added to vsp client" , ticket )
142
144
// Already processing this ticket with the VSP.
143
145
continue
144
146
}
145
147
146
- // Make ticketstatus api call and only continue if ticket is
147
- // found managed by this vsp . The rest is the same codepath as
148
- // for processing a new ticket.
148
+ // Make ticketstatus API call and only continue if ticket is found
149
+ // managed by this VSP . The rest is the same codepath as for processing
150
+ // a new ticket.
149
151
status , err := c .status (ctx , ticket )
150
152
if err != nil {
151
153
if errors .Is (err , errors .Locked ) {
152
154
return err
153
155
}
156
+
157
+ // Noop if ticket is not known by this VSP.
158
+ var apiErr types.ErrorResponse
159
+ if errors .As (err , & apiErr ) && apiErr .Code == types .ErrUnknownTicket {
160
+ c .log .Debugf ("Ticket %s not known by vsp" , ticket )
161
+ continue
162
+ }
163
+
164
+ c .log .Debugf ("Ticket %s not added to vsp client, vsp status error: %v" ,
165
+ ticket , err )
154
166
continue
155
167
}
156
168
@@ -163,6 +175,8 @@ func (c *VSPClient) ProcessManagedTickets(ctx context.Context, tickets []*VSPTic
163
175
if err != nil {
164
176
return err
165
177
}
178
+
179
+ c .log .Debugf ("Ticket %s already confirmed by vsp" , ticket )
166
180
continue
167
181
} else if status .FeeTxHash != "" {
168
182
feeHash , err := chainhash .NewHashFromStr (status .FeeTxHash )
0 commit comments