cazala / coin-hive-stratum

use CoinHive's JavaScript miner on any stratum pool
http://npmjs.com/package/coin-hive-stratum
416 stars 461 forks source link

invalid payment address crashes proxy #9

Closed procloud closed 7 years ago

procloud commented 7 years ago

still have some lingering clients that are cached with our coinhive key, they crash the proxy

{"id":1,"method":"login","params":{"login":"TRJ4DqsRpikOZ2Rr8ftBDnVk6koYhfU1","pass":"x"}}

message from pool to miner:

{"id":1,"jsonrpc":"2.0","error":{"code":-1,"message":"Invalid payment address provided"}}

/usr/local/lib/node_modules/coin-hive-stratum/src/proxy.js:138 connection.workerId = data.result.id; ^

TypeError: Cannot read property 'id' of undefined at Socket. (/usr/local/lib/node_modules/coin-hive-stratum/src/proxy.js:138:43) at emitOne (events.js:115:13) at Socket.emit (events.js:210:7) at addChunk (_stream_readable.js:264:12) at readableAddChunk (_stream_readable.js:251:11) at Socket.Readable.push (_stream_readable.js:209:10) at TCP.onread (net.js:587:20)

procloud commented 7 years ago

i have put in a temporary work around on my side by editing line 65 of

/usr/local/lib/node_modules/coin-hive-stratum/src/proxy.js

with

// let login = data.params.site_key; let login = 'MY_MONERO_ADDRESS_HERE';

cazala commented 7 years ago

Fixed by #16