Bitcoin Forum
May 06, 2024, 01:51:56 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: API call 'sendfrom' not working  (Read 1637 times)
bananas (OP)
Sr. Member
****
Offline Offline

Activity: 364
Merit: 257


View Profile
March 04, 2014, 05:27:35 AM
 #1

I make a 'getbalance' call to  be sure that there are enough funds, it works. Then i use 'sendfrom' to send from an account to an address and it just does not work:

$btc = "0.01000000";

$call = $api->call('sendfrom', $sender_account, $receiving_address, $btc,6);

it just returns null, so i have no idea what the error is.

I'm using the testnet.
1714960316
Hero Member
*
Offline Offline

Posts: 1714960316

View Profile Personal Message (Offline)

Ignore
1714960316
Reply with quote  #2

1714960316
Report to moderator
1714960316
Hero Member
*
Offline Offline

Posts: 1714960316

View Profile Personal Message (Offline)

Ignore
1714960316
Reply with quote  #2

1714960316
Report to moderator
You can see the statistics of your reports to moderators on the "Report to moderator" pages.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714960316
Hero Member
*
Offline Offline

Posts: 1714960316

View Profile Personal Message (Offline)

Ignore
1714960316
Reply with quote  #2

1714960316
Report to moderator
bananas (OP)
Sr. Member
****
Offline Offline

Activity: 364
Merit: 257


View Profile
March 04, 2014, 07:34:23 AM
 #2

Well, i tested not using variables for the params. Instead i hardcoded the parameters and it worked. Why it would not work with variables? I've checked and the var values are all correct.
Automatic
Full Member
***
Offline Offline

Activity: 238
Merit: 105


View Profile
March 04, 2014, 05:25:03 PM
 #3

Well, i tested not using variables for the params. Instead i hardcoded the parameters and it worked. Why it would not work with variables? I've checked and the var values are all correct.


Open up wireshark, compare the difference?

Please ask for a signed message from my on-site Bitcoin address (Check my profile) before doing any offsite trades with me.
Vortuarackne
Newbie
*
Offline Offline

Activity: 28
Merit: 0


View Profile
March 04, 2014, 09:58:51 PM
 #4

I make a 'getbalance' call to  be sure that there are enough funds, it works. Then i use 'sendfrom' to send from an account to an address and it just does not work:

$btc = "0.01000000";

$call = $api->call('sendfrom', $sender_account, $receiving_address, $btc,6);

it just returns null, so i have no idea what the error is.

I'm using the testnet.

Make sure $btc is a numeric value rather than a string, in php;

Code:
$btc = floatval("0.01000000");

$call = $api->call('sendfrom', $sender_account, $receiving_address, $btc,6);

Your confirmation number may also need to be an int (e.g. intval("6") )
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!