Author

Topic: Need help with bitcoind and jsonRPCClient (Read 783 times)

kjj
legendary
Activity: 1302
Merit: 1026
July 19, 2013, 08:53:24 AM
#3
Yes, the root problem that you can't omit a leading argument.  All three of the parameters are optional, but if present, they will be interpreted in the order listed.  This may not be obvious to people that don't program much, so I'm pointing it out to future searchers.

The default account is named by an empty string.  If you look at the bitcoind source code, you'll see that the account name defaults to '*', and is overwritten with the first argument.
member
Activity: 100
Merit: 10
sorry, for posting, I've searched and found my answer...

need to call the account = '*'

Thanks! Smiley
member
Activity: 100
Merit: 10
Hi,
I wonder, if somebody could help with with PHP jsonRPCClient.

I am trying to pull 10 last transactions for ALL accounts from bitcoind using jsonRPCClient.

I do something like this:
$account = '';
$count_trns = 10;
$start_from = 0;
$trn_array = $bitcoin->listtransactions($account, $count_trns, $start_from);

This gives me ONLY the transactions for the main account (where account name is empty).
The listtransactions says: "If [account] not provided will return recent transaction from all accounts."
But when I do:
$trn_array = $bitcoin->listtransactions($count_trns, $start_from);

It doesn't work (PHP Warning:  fopen(http://[email protected]:8332/): failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error
 in /../jsonRPCClient.php on line 132)

I've temporary resolved it by calling listtransactions(); - without any parameters
But as the list of transactions grows I would like to call it with limit.

So, the question is how can I pull 10 last transactions for ALL accounts?



Jump to: