Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

500 Code Sent Back From Daemon #9

Open
dcrdev opened this issue Mar 1, 2015 · 4 comments
Open

500 Code Sent Back From Daemon #9

dcrdev opened this issue Mar 1, 2015 · 4 comments

Comments

@dcrdev
Copy link

dcrdev commented Mar 1, 2015

With PHP 5.6 and Bitcoin 0.10.0, +Coin is sending incorrect headers to bitcoind resulting in an 500 response. I beleive this may be down to recent changes in PHP 5.6 which means that cookies are being sent with fopen by default now. I could be wrong but I don't know much about the bitcoind RPC spec.

@Someguy123
Copy link
Owner

That's extremely strange. It uses the well-known JSONRPC library used by almost every daemon-based web application, are you sure it's headers? Bitcoin will return a 500 for a lot of reasons, often being you sending the wrong data type (i.e. string instead of float), or because it's still synchronizing the blockchain.

@dcrdev
Copy link
Author

dcrdev commented Mar 1, 2015

I modified the code a bit changing line 141 to:
throw new exception('Request error: '.$response['error']['code'].' - '.$response['error']['message']);

To get a more specific response back: I'm only getting this "'Request error: Array" so it seems the json getting sent is malformed in some way (or at least bitcoind thinks so).

@Someguy123
Copy link
Owner

Yeah, not sure what to do here. the JSONRPC library would be to blame here. It's worked on 5.4 and 5.5 previously without any issues, but this was also with older versions of Bitcoin, not sure if their RPC spec changed in some way too...

If you can figure it out and submit a pull request (without breaking older versions of PHP...), I'd be happy to accept it.

@LazyGatto
Copy link

Got the same issue.
Had to fix in 'index.php' lines 11-12 from null to "*"

$bal = $nmc->getbalance("*", 3);
$bal3 = $nmc->getbalance("*", 0);

BTW, fixed to 3 confirmations as it enough to make further transactions ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants