Ruzihm / coin-chance

An open source crypto currency play-and-invest gambling site
GNU Affero General Public License v3.0
35 stars 23 forks source link

Cannot withdraw #21

Closed fedaykinofdune closed 10 years ago

fedaykinofdune commented 10 years ago

For some reason I get the following when trying to withdraw now.

getuserbalance Got balance: 0 divesting 100 2555.5908783990994864 [src/routes/sock.js] User Admin submitted withdraw: {"address":"XXXXXXXXXXXXXXXXXXXXXXXXX","amount":"95.5"}. [src/routes/sock.js] Amount is not a number or address is invalid. getuserbalance Got balance: 0

Ruzihm commented 10 years ago

Looks like cryptoaddress-validator https://github.com/geophoenix/cryptoaddress-validator/blob/master/main.js doesn't think that is a valid address.

What coin is the address (the one being censored) for?

fedaykinofdune commented 10 years ago

Its for Denarius. The address I gave it was good, I manually sent coins with no problem.

On Wed, Jun 18, 2014 at 7:22 AM, Richard Van Tassel < notifications@github.com> wrote:

I mean, obviously not "XXX..." but what coin is the hidden address :P

Rick Van Tassel

On Wed, Jun 18, 2014 at 8:21 AM, Richard Van Tassel rickvt@gmail.com wrote:

Looks like cryptoaddress-validator < https://github.com/geophoenix/cryptoaddress-validator/blob/master/main.js>

doesn't think that is a valid address.

What coin is that for?

Rick Van Tassel

On Wed, Jun 18, 2014 at 8:03 AM, fedaykinofdune < notifications@github.com> wrote:

For some reason I get the following when trying to withdraw now.

getuserbalance Got balance: 0 divesting 100 2555.5908783990994864 [src/routes/sock.js] User Admin submitted withdraw: {"address":"XXXXXXXXXXXXXXXXXXXXXXXXX","amount":"95.5"}. [src/routes/sock.js] Amount is not a number or address is invalid. getuserbalance Got balance: 0

— Reply to this email directly or view it on GitHub https://github.com/Ruzihm/coin-chance/issues/21.

— Reply to this email directly or view it on GitHub https://github.com/Ruzihm/coin-chance/issues/21#issuecomment-46428327.

Ruzihm commented 10 years ago

Go into your coin-chance directory run nodejs, and put in the following:

var cav=require("cryptoaddress-validator");
cav("XXXX..."); 

and confirm that it returns false. If so, I'd raise an issue with the cryptoaddress-validator dev.

Ruzihm commented 10 years ago

And you might also want to direct him to the last 2 posts in this thread as well: https://bitcointalk.org/index.php?topic=9838.0

fedaykinofdune commented 10 years ago

Yep, it is definitely failing validation.

fedaykinofdune commented 10 years ago

Would it be overly difficult just to change the validation method to use the coin daemon's validateaddress function?

Ruzihm commented 10 years ago

I can certainly do that. I'll do that by the end of the week

fedaykinofdune commented 10 years ago

Thanks :) What would be the easiest way to bypass it for now, on the one giving me problems? I'm assuming I can change a variable somewhere to where the address never fails validation no matter what?

Ruzihm commented 10 years ago

For now you could just change src/routes/sock.js from

    if (isNaN(data.amount) ||
        !CryptoAddressCheck(data.address)) {
        console.log("[src/routes/sock.js] Amount is not a number or address is invalid.");
        withdrawComplete();
        return;
    }

to

    if (isNaN(data.amount) ) {
        console.log("[src/routes/sock.js] Amount is not a number or address is invalid.");
        withdrawComplete();
        return;
    }
fedaykinofdune commented 10 years ago

Awesome, thank you! Denarius is the only one we've had address issues with so far, though I'm certain BirdCoin has the same issue. I definitely prefer validating against the coin daemon, though, some coins aren't well put together and addresses will fail outside checks, though to the daemon they're perfectly valid.