add NumOfOrders method on active book

This commit is contained in:
c9s 2021-05-13 19:41:05 +08:00
parent c520cfa540
commit c8b97629e0

View File

@ -152,6 +152,10 @@ func (b *LocalActiveOrderBook) WriteOff(order types.Order) bool {
return false
}
func (b *LocalActiveOrderBook) NumOfOrders() int {
return b.Asks.Len() + b.Bids.Len()
}
func (b *LocalActiveOrderBook) Orders() types.OrderSlice {
return append(b.Asks.Orders(), b.Bids.Orders()...)
}