Skip to content
This repository has been archived by the owner on Jun 8, 2020. It is now read-only.

Commit

Permalink
Fix for issue #105 (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
traviscollins authored and dozd committed Feb 27, 2018
1 parent fd20ec7 commit efc957e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void createFromLevels(GeminiLimitOrder[] levels) {
public void updateLevel(GeminiLimitOrder level) {
SortedMap<BigDecimal, GeminiLimitOrder> orderBookSide = level.getSide() == Order.OrderType.ASK ? asks : bids;
boolean shouldDelete = level.getAmount().compareTo(zero) == 0;
BigDecimal price = level.getPrice();
BigDecimal price = new BigDecimal(level.getPrice().toString()); // copy of the price is required for thread safety (BigDecimal is not thread safe, and the hashcode can be affected by outside accesses of the value)
orderBookSide.remove(price);
if (!shouldDelete) {
orderBookSide.put(price, level);
Expand Down

0 comments on commit efc957e

Please sign in to comment.