Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: ineededausername on October 15, 2011, 08:45:23 PM



Title: sendmany
Post by: ineededausername on October 15, 2011, 08:45:23 PM
I have 2btc in a wallet and tried to do this:

               $txid2 = $bitcoin->sendmany("", $payoutArray);

sum of values in payoutarray is 0.6.  It says:

Error: Request error: Account has insufficient funds

Anyone know why?


Title: Re: sendmany
Post by: casascius on October 15, 2011, 09:04:41 PM
Sendmany cares about what "account" the BTC are in - you have passed an empty string - those 2 BTC must be in the "account" named the empty string for it to work.  Try the listaccounts RPC command.  There's also a move command that moves coins between accounts.  This phenomenon of "accounts" is internal to the client and I don't think it represents any attribute of the bitcoins themselves as seen by the network.

I use sendmany all the time for loading batches of Casascius Physical Bitcoins.


Title: Re: sendmany
Post by: ineededausername on October 15, 2011, 09:14:14 PM
Sendmany cares about what "account" the BTC are in - you have passed an empty string - those 2 BTC must be in the "account" named the empty string for it to work.  Try the listaccounts RPC command.  There's also a move command that moves coins between accounts.  This phenomenon of "accounts" is internal to the client and I don't think it represents any attribute of the bitcoins themselves as seen by the network.

I use sendmany all the time for loading batches of Casascius Physical Bitcoins.

I see.  Is there any way to just sendmany from my wallet in general in a convenient way?  I couldn't care less about accounts; I want to treat my wallet as one monolithic account but bitcoind won't let me.


Title: Re: sendmany
Post by: ineededausername on October 15, 2011, 09:21:53 PM
Update: Now I move coins to a special sendmany account before trying to sendmany but it still doesn't work.  It wants to CONFIRM A TRANSACTION I SEND TO MYSELF before adding the balance.


Title: Re: sendmany
Post by: Gavin Andresen on October 16, 2011, 07:21:17 PM
Update: Now I move coins to a special sendmany account before trying to sendmany but it still doesn't work.  It wants to CONFIRM A TRANSACTION I SEND TO MYSELF before adding the balance.
Pass a 0 as the third argument to sendmany and it will send unconfirmed coins:
 
Code:
sendmany <fromaccount> {address:amount,...} [minconf=1] [comment]


Title: Re: sendmany
Post by: lucif on February 27, 2013, 08:52:07 PM
Sorry for thread necromancy, but problem is actual.

I have website that may require to send great number of [possibly small] transactions.

So instead of sending each payment in different transaction, I want to send them on batch basis with sendmany to do not spam network much.

But I am unable to do this coz of this stupid "fromaccount" parameter - I have many accounts with incoming transactions. Why not just send from any account?


Title: Re: sendmany
Post by: lucif on February 27, 2013, 08:56:14 PM
Add: sendmany with empty account says

{"result":null,"error":{"code":-6,"message":"Account has insufficient funds"},"id":1}

(wallet balance is good enough though)

EDIT: I think I got it. I either use accounts or dont use them at all.