zone117x / node-open-mining-portal

A scalable all-in-one easy to setup cryptocurrency mining pool and portal written entirely in Node.js.
GNU General Public License v2.0
1.02k stars 1.03k forks source link

Syscoin Address Validate Error #364

Open jetbalsa opened 10 years ago

jetbalsa commented 10 years ago

Some people where mining with SU1UwsmBKftuJHEcg2mf78KqsgoTcGzfzT.mine2 as their worker name on a normal Redis backed NOMP with Syscoin and it was storing the data in the REDIS database, but it would try to do a sendmany with some odd short address

I narrowed it down to paymentprocessor.js

var getProperAddress = function(address){
    if (address.length === 40){
        return util.addressFromEx(poolOptions.address, address);
    }
    else return address;
};

I resolved the issue for now by doing

var getProperAddress = function(address){
    if (address.length === 40){
        var res = address.split(".");
        return res[0];
    }
    else return address;
};

and this resolved the issue, Please do not allow miners with invalid address to even mine at all, it just spams up the database and makes thing hard

sigwo commented 10 years ago

I think there is a setting in the config.json that you can set to true and it rejects non-validated addresses, even against the wallet daemon. So, a BTC address wouldn't work for a LTC address. Is this not it? Or am I missing something? I've seen addresses get rejected while watching my screen session https://github.com/zone117x/node-open-mining-portal/blob/master/config_example.json#L17

jetbalsa commented 10 years ago

yes, but if the address is exactly the length of 40 it overrides this and breaks payouts

if (address.length === 40){

jwrb commented 10 years ago

I've observed this behaviour over at TeamDoge; we need some better address validation / parsing to truly sort this issue out. We've been having issues with invalid address' that clog up the system in a similar way to what @jrwr is suggesting.