diff --git a/client/core/bookie.go b/client/core/bookie.go index b6c8fc313c..547261b5fe 100644 --- a/client/core/bookie.go +++ b/client/core/bookie.go @@ -254,7 +254,6 @@ func (b *bookie) closeFeeds() { close(f.c) } b.feeds = make(map[uint32]*bookFeed, 1) - } // candles fetches the candle set from the server and activates the candle @@ -448,8 +447,8 @@ func (dc *dexConnection) syncBook(base, quote uint32) (*orderbook.OrderBook, Boo dc.books[mktID] = booky } - // Get the feed and the book under a single lock to make sure the first - // message is the book. + // Get the feed and the book under a single lock to make sure the first message is "book" + // (so that nobody else could send anything on this feed concurrently). feed := booky.newFeed(&BookUpdate{ Action: FreshBookAction, Host: dc.acct.host, diff --git a/client/mm/mm_basic.go b/client/mm/mm_basic.go index 438bcceab5..0ddb042935 100644 --- a/client/mm/mm_basic.go +++ b/client/mm/mm_basic.go @@ -408,7 +408,7 @@ func (m *basicMarketMaker) ordersToPlace() (buyOrders, sellOrders []*TradePlacem if err != nil { return nil, nil, fmt.Errorf("fetch Bison book: %v", err) } - defer feed.Close() // have to release resources, otherwise feed isn't used here + defer feed.Close() // have to release resources, feed isn't used here otherwise // bestBuy falls back to basisPrice-4%, this is a reasonably safe reference point bestBuy := steppedRate(uint64(float64(basisPrice)-0.04*float64(basisPrice)), m.rateStep)