Skip to content

Commit

Permalink
sidecar: remove shims after failing a batch
Browse files Browse the repository at this point in the history
We were not canceling all the funding shims after failing a batch which
would triggere future matches with that node to fail.
  • Loading branch information
positiveblue committed Feb 18, 2022
1 parent 18898ab commit d0c07e0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions sidecar_acceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,15 @@ func (a *SidecarAcceptor) getSidecarAsOrder(o order.Nonce) (order.Order, error)
func (a *SidecarAcceptor) sendRejectBatch(batchID []byte, batch *order.Batch,
failure error) error {

if batch != nil {
// As we're rejecting this batch, we'll now cancel all funding shims
// that we may have registered since we may be matched with a distinct
// set of channels if this batch is repeated.
if err := a.removeShims(batch); err != nil {
return err
}
}

msg := &auctioneerrpc.ClientAuctionMessage_Reject{
Reject: &auctioneerrpc.OrderMatchReject{
BatchId: batchID,
Expand Down

0 comments on commit d0c07e0

Please sign in to comment.