{"action":"created","issue":{"url":"https://api.github.com/repos/paritytrading/parity/issues/118","repository_url":"https://api.github.com/repos/paritytrading/parity","labels_url":"https://api.github.com/repos/paritytrading/parity/issues/118/labels{/name}","comments_url":"https://api.github.com/repos/paritytrading/parity/issues/118/comments","events_url":"https://api.github.com/repos/paritytrading/parity/issues/118/events","html_url":"https://github.com/paritytrading/parity/issues/118","id":324919364,"node_id":"MDU6SXNzdWUzMjQ5MTkzNjQ=","number":118,"title":"canceledQuantity of event Cancel wrong","user":{"login":"congnghia0609","id":5478141,"node_id":"MDQ6VXNlcjU0NzgxNDE=","avatar_url":"https://avatars1.githubusercontent.com/u/5478141?v=4","gravatar_id":"","url":"https://api.github.com/users/congnghia0609","html_url":"https://github.com/congnghia0609","followers_url":"https://api.github.com/users/congnghia0609/followers","following_url":"https://api.github.com/users/congnghia0609/following{/other_user}","gists_url":"https://api.github.com/users/congnghia0609/gists{/gist_id}","starred_url":"https://api.github.com/users/congnghia0609/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/congnghia0609/subscriptions","organizations_url":"https://api.github.com/users/congnghia0609/orgs","repos_url":"https://api.github.com/users/congnghia0609/repos","events_url":"https://api.github.com/users/congnghia0609/events{/privacy}","received_events_url":"https://api.github.com/users/congnghia0609/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-05-21T13:38:02Z","updated_at":"2018-09-16T15:54:49Z","closed_at":"2018-09-16T15:54:49Z","author_association":"NONE","body":"Bug is find in function **cancel** in class **OrderBook**:\r\n``` java\r\npublic void cancel(long orderId, long size) {\r\n        Order order = orders.get(orderId);\r\n        if (order == null)\r\n            return;\r\n\r\n        long remainingQuantity = order.getRemainingQuantity();\r\n\r\n        if (size >= remainingQuantity)\r\n            return;\r\n\r\n        if (size > 0) {\r\n            order.resize(size);\r\n        } else {\r\n            delete(order);\r\n\r\n            orders.remove(orderId);\r\n        }\r\n\r\n        listener.cancel(orderId, remainingQuantity - size, size);\r\n    }\r\n```\r\nBecause remainingQuantity in Order get from ```Long2ObjectOpenHashMap<Order> orders``` difference with Order get from ```Long2ObjectRBTreeMap<PriceLevel> bids``` or ```Long2ObjectRBTreeMap<PriceLevel> asks```. Then, value return ```canceledQuantity = remainingQuantity - size``` is wrong."},"comment":{"url":"https://api.github.com/repos/paritytrading/parity/issues/comments/421786720","html_url":"https://github.com/paritytrading/parity/issues/118#issuecomment-421786720","issue_url":"https://api.github.com/repos/paritytrading/parity/issues/118","id":421786720,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMTc4NjcyMA==","user":{"login":"jvirtanen","id":183430,"node_id":"MDQ6VXNlcjE4MzQzMA==","avatar_url":"https://avatars3.githubusercontent.com/u/183430?v=4","gravatar_id":"","url":"https://api.github.com/users/jvirtanen","html_url":"https://github.com/jvirtanen","followers_url":"https://api.github.com/users/jvirtanen/followers","following_url":"https://api.github.com/users/jvirtanen/following{/other_user}","gists_url":"https://api.github.com/users/jvirtanen/gists{/gist_id}","starred_url":"https://api.github.com/users/jvirtanen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jvirtanen/subscriptions","organizations_url":"https://api.github.com/users/jvirtanen/orgs","repos_url":"https://api.github.com/users/jvirtanen/repos","events_url":"https://api.github.com/users/jvirtanen/events{/privacy}","received_events_url":"https://api.github.com/users/jvirtanen/received_events","type":"User","site_admin":false},"created_at":"2018-09-16T15:54:49Z","updated_at":"2018-09-16T15:54:49Z","author_association":"MEMBER","body":"Closing this issue due to inactivity."}}
{"actor":{"display_login":"jvirtanen"}}