Skip to content

Commit 5824c3c

Browse files
author
Chris Clark
committedMay 21, 2015
Prevent crash when listening for "model" events on the OrderBook class and an issuer creates an order with one of their issues
1 parent 45a1b94 commit 5824c3c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎src/orderbook.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,11 @@ OrderBook.prototype.notify = function(transaction) {
924924
break;
925925

926926
case 'CreatedNode':
927-
self.setOwnerFunds(node.fields.Account, transactionOwnerFunds);
927+
// rippled does not set owner_funds if the order maker is the issuer
928+
// because the value would be infinite
929+
var fundedAmount = transactionOwnerFunds !== undefined ?
930+
transactionOwnerFunds : Infinity;
931+
self.setOwnerFunds(node.fields.Account, fundedAmount);
928932
self.insertOffer(node);
929933
break;
930934
}

0 commit comments

Comments
 (0)
Please sign in to comment.