Skip to content

Commit

Permalink
Buck review updates
Browse files Browse the repository at this point in the history
  • Loading branch information
martonp committed Nov 10, 2023
1 parent 9b8ca86 commit 6b6a544
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client/mm/libxc/binance.go
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ func (bnc *binance) requestInto(req *http.Request, thing interface{}) error {
return nil
}
// TODO: use buffered reader
reader := io.LimitReader(resp.Body, 1<<20)
reader := io.LimitReader(resp.Body, 1<<22)
r, err := io.ReadAll(reader)
if err != nil {
return err
Expand Down
13 changes: 13 additions & 0 deletions client/mm/mm_arb_market_maker.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,19 @@ func (a *arbMarketMaker) processDEXOrderNote(note *core.OrderNote) {
delete(a.ords, oid)
delete(a.oidToPlacement, oid)
a.ordMtx.Unlock()

a.matchesMtx.Lock()
for _, match := range note.Order.Matches {
var matchID order.MatchID
copy(matchID[:], match.MatchID)
if a.matchesSeen[matchID] {
fmt.Printf("deleting seen match %s\n", matchID)
} else {
fmt.Printf("not deleting unseen match %s\n", matchID)
}
delete(a.matchesSeen, matchID)
}
a.matchesMtx.Unlock()
}
}

Expand Down
2 changes: 1 addition & 1 deletion client/mm/mm_arb_market_maker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ func TestArbMarketMakerDEXUpdates(t *testing.T) {

tests := []*test{
{
name: "one buy and one cell match notifications",
name: "one buy and one sell match notifications",
orders: []*core.Order{
{
ID: orderIDs[0][:],
Expand Down

0 comments on commit 6b6a544

Please sign in to comment.