Bitcoin Forum
April 24, 2024, 06:43:23 PM *
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.
1713984203
Hero Member
*
Offline Offline

Posts: 1713984203

View Profile Personal Message (Offline)

Ignore
1713984203
Reply with quote  #2

1713984203
Report to moderator
1713984203
Hero Member
*
Offline Offline

Posts: 1713984203

View Profile Personal Message (Offline)

Ignore
1713984203
Reply with quote  #2

1713984203
Report to moderator
There are several different types of Bitcoin clients. The most secure are full nodes like Bitcoin Core, which will follow the rules of the network no matter what miners do. Even if every miner decided to create 1000 bitcoins per block, full nodes would stick to the rules and reject those blocks.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
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!