diff --git a/lib/graphql/resolvers.js b/lib/graphql/resolvers.js index 1c5564b8..2502f50a 100644 --- a/lib/graphql/resolvers.js +++ b/lib/graphql/resolvers.js @@ -198,7 +198,10 @@ const dynamicConfig = ({ deviceId, operatorId, pid, pq, settings, }) => { _.toPairs, /* [[cryptoCode, { balance, ask, bid, cashIn, cashOut }], ...] => [{ cryptoCode, balance, ask, bid, cashIn, cashOut }, ...] */ - _.map(([cryptoCode, obj]) => _.set('cryptoCode', cryptoCode, obj)) + _.map(([cryptoCode, obj]) => _.set('cryptoCode', cryptoCode, obj)), + + /* Only send coins which have all information needed by the machine. This prevents the machine going down if there's an issue with the coin node */ + _.filter(coin => ['ask', 'bid', 'balance', 'cashIn', 'cashOut', 'cryptoCode'].every(it => it in coin)) )(_.concat(balances, coins)) }),