ripple / ripple-lib-extensions

[Deprecated] A collection of extensions to ripple-lib. Instead, see https://github.com/XRPLF/xrpl.js
https://github.com/XRPLF/xrpl.js
22 stars 31 forks source link

Orderbook extension always crashes after running for a while #27

Open flxh opened 8 years ago

flxh commented 8 years ago

Every time I use the orderbook extension it crashes after running for a couple of hours with the following stack trace:

assert.js:89 throw new assert.AssertionError({ ^ AssertionError: Offer total cannot be negative at OrderBook._subtractOwnerOfferTotal (/home/bot/ripple-lib-extensions/orderbook/dist/npm/orderbook.js:693:7) at OrderBook._deleteOffer (/home/bot/ripple-lib-extensions/orderbook/dist/npm/orderbook.js:660:16) at OrderBook._processTransactionNode (/home/bot/ripple-lib-extensions/orderbook/dist/npm/orderbook.js:448:18) at Array.forEach (native) at OrderBook._processTransaction (/home/bot/ripple-lib-extensions/orderbook/dist/npm/orderbook.js:426:23) at OrderBook._onTransaction (/home/bot/ripple-lib-extensions/orderbook/dist/npm/orderbook.js:378:14) at emitOne (events.js:101:20) at RestrictedConnection.emit (events.js:188:7) at RestrictedConnection._onMessage (/home/bot/app/node_modules/ripple-lib/dist/npm/common/connection.js:123:17) at emitTwo (events.js:106:13) at WebSocket.emit (events.js:191:7)

I tried with a variety of different asset pairs but every time I receive the same result. I use the orderbook extension just to receive the events emmited by it. And since this stack trace doesnt involve any of my own code I really think this is flaw in the code of the Orderbook.js. What would happen if we just delete this assertion line ?

FrRichard commented 7 years ago

I'm having the same problem , is this extension reliable ?

flxh commented 7 years ago

I stopped using it after struggling with this problem for a while, so I can't tell honestly.