• Forum has been upgraded, all links, images, etc are as they were. Please see Official Announcements for more information

PHP rpc sendfrom 500 Internal Server Error

Gaby_64

New member
PHP Warning: fopen(http://[email protected]:9998/): failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error
in /var/www/html/php/rpc/jsonRPCClient.php on line 132
PHP Fatal error: Uncaught Exception: Unable to connect to http://dashrpc:*******@127.0.0.1:9998/ in /var/www/html/php/rpc/jsonRPCClient.php:140
Stack trace:
#0 /var/www/html/php/cryptoupdate.php(99): jsonRPCClient->__call('sendfrom', Array)
cryptoupdate.php:
PHP:
$dashaccounts = $dash->listaccounts();
foreach ($dashaccounts as $key => $val) {
    if($val > 0) {
      $txid = $dash->sendfrom((string)$key, "Xf2ppdsmmmgbqHYEjiXLwShnjB9NnVYbgK", $val - 0.0001);
   }
}
 
Last edited:
cryptoupdate.php:
PHP:
$dashaccounts = $dash->listaccounts();
foreach ($dashaccounts as $key => $val) {
    if($val > 0) {
      $txid = $dash->sendfrom((string)$key, "Xf2ppdsmmmgbqHYEjiXLwShnjB9NnVYbgK", $val - 0.0001);
   }
}

Can you explain exactly what you're trying to do and show all the necessary code? What PHP library are you using to connect to the JSONRPC? I recommend the BitWasp libraries if you're needing to use PHP.

Looks like you can't connect for some reason, maybe bad credentials, but I can't tell with the limited info you posted.
 
Can you explain exactly what you're trying to do and show all the necessary code? What PHP library are you using to connect to the JSONRPC? I recommend the BitWasp libraries if you're needing to use PHP.

Looks like you can't connect for some reason, maybe bad credentials, but I can't tell with the limited info you posted.

the code is above, it connects just fine, listaccounts is working, im using Sergio Vaccaro implementation of JSON-RPC

what im trying to do is check every minute for a balance and then send the funds to another wallet while also doing some database manipulation to register the donation and issue tokens

this might be relevant https://bitcointalk.org/index.php?topic=52024.0
 
Last edited:
Re senfrom and subtractfeefromamount:
Current versions of Dash are based on bitcoin 0.10 i.e. no subtractfeefromamount supported. New release is going to be a fork of bitcoin 0.12 so sendfrom is going to be depreciated in Dash 0.12.1.x, subtractfeefromamount is going to be supported by sendtoaddress, instandsendtoaddress and sendmany.

Re high fee:
Make sure you are running at least 0.12.0.58, older versions had a bug in calculations. Also remove fee_estimates.dat to reset data for calculations.
 
Re senfrom and subtractfeefromamount:
Current versions of Dash are based on bitcoin 0.10 i.e. no subtractfeefromamount supported. New release is going to be a fork of bitcoin 0.12 so sendfrom is going to be depreciated in Dash 0.12.1.x, subtractfeefromamount is going to be supported by sendtoaddress, instandsendtoaddress and sendmany.

Re high fee:
Make sure you are running at least 0.12.0.58, older versions had a bug in calculations. Also remove fee_estimates.dat to reset data for calculations.

my-brain-is-full-of-fuck.jpg

Please don't deprecate it and rather fix it, otherwise what's the point of the accounts system?

Its a new install, should be latest and there should be no reason fee estimates is off.

So I should use move and then sendtoaddress?
 
Last edited:
There is actually no point in accounts system and it's recommended to never use it because it was "broken" since the first version of bitcoin wallet. You cannot rely on it if you build any service and should build your own system instead or you'll end up in a complete mess. Basically that's why all functions related to accounts are finally going to be deprecated by bitcoin and us.
 
so what rpc calls should i be using?

I want to automatically send received funds to another wallet and i need to know the receive address to add entry's in a database.

I have found that walletnotify exists, so i will be using that
 
Last edited:
Back
Top