Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: mb300sd on June 19, 2012, 11:08:45 PM



Title: Cannot send unconfirmed coins from rpc.
Post by: mb300sd on June 19, 2012, 11:08:45 PM
I cannot seem to get bitcoind to allow me to send 0-confirm coins. Is this by design, or a bug? I'm using the latest version from the ubuntu ppa.

I've tried both sendfrom and sendmany.

sendfrom <fromaccount> <tobitcoinaddress> <amount> [minconf=1] [comment] [comment-to]
sendmany <fromaccount> {address:amount,...} [minconf=1] [comment]

root@bt:~# bitcoind getbalance
2.8245

root@bt:~# bitcoind getbalance "" 0
23.7164

root@bt:~# bitcoind sendfrom "" 1Meb94yEgFWN8SQ5JYVNTXU12qBa7a1eiY 20 0
error: {"code":-4,"message":"Insufficient funds"}


Title: Re: Cannot send unconfirmed coins from rpc.
Post by: Aseras on June 19, 2012, 11:44:20 PM
0 confirm coins don't exist they aren't included in a block yet. Theres no header to include. You don't know what block they will be included in.


Title: Re: Cannot send unconfirmed coins from rpc.
Post by: mcorlett on June 19, 2012, 11:46:04 PM
0 confirm coins don't exist they aren't included in a block yet. Theres no header to include. You don't know what block they will be included in.
What are you talking about?! You reference previous transactions, not blocks or block headers.


Title: Re: Cannot send unconfirmed coins from rpc.
Post by: Gavin Andresen on June 19, 2012, 11:52:48 PM
The RPC and GUI won't let you spend 0-confirmation transactions unless they are 'change' outputs from yourself.

If you REALLY want to shoot yourself in the foot, I've got a pull request for the 0.7 release that adds 'raw transaction' RPC commands that will let you do all sorts of dangerous things, including counting your chickens before they've hatched spending unconfirmed-from-somewhere-else inputs.


Title: Re: Cannot send unconfirmed coins from rpc.
Post by: mcorlett on June 19, 2012, 11:54:12 PM
If you REALLY want to shoot yourself in the foot, I've got a pull request for the 0.7 release that adds 'raw transaction' RPC commands that will let you do all sorts of dangerous things, including counting your chickens before they've hatched spending unconfirmed-from-somewhere-else inputs.
...there is also Brainwallet's transaction composer (http://brainwallet.org/#transactions). Very handy, and I think it'll do unconfirmed transactions just fine!


Title: Re: Cannot send unconfirmed coins from rpc.
Post by: mb300sd on June 19, 2012, 11:55:29 PM
The RPC and GUI won't let you spend 0-confirmation transactions unless they are 'change' outputs from yourself.

If you REALLY want to shoot yourself in the foot, I've got a pull request for the 0.7 release that adds 'raw transaction' RPC commands that will let you do all sorts of dangerous things, including counting your chickens before they've hatched spending unconfirmed-from-somewhere-else inputs.


Thanks. That works for me, the 20BTC transaction was just an example I could post quickly, I'm really writing a satoshidice bot, and I'd like to keep it's balance very low...

I've never noticed that it didn't allow it before, I use coin control and send to myself fairly often, I'm guessing those transactions are included as "change"


Title: Re: Cannot send unconfirmed coins from rpc.
Post by: BasementMiner! on June 20, 2012, 01:32:11 AM
The RPC and GUI won't let you spend 0-confirmation transactions unless they are 'change' outputs from yourself.

If you REALLY want to shoot yourself in the foot, I've got a pull request for the 0.7 release that adds 'raw transaction' RPC commands that will let you do all sorts of dangerous things, including counting your chickens before they've hatched spending unconfirmed-from-somewhere-else inputs.


I'll be looking out for short-lived 10 million Bitcoin transactions on blockchain.info! :D


Title: Re: Cannot send unconfirmed coins from rpc.
Post by: mcorlett on June 20, 2012, 02:22:02 AM
The RPC and GUI won't let you spend 0-confirmation transactions unless they are 'change' outputs from yourself.

If you REALLY want to shoot yourself in the foot, I've got a pull request for the 0.7 release that adds 'raw transaction' RPC commands that will let you do all sorts of dangerous things, including counting your chickens before they've hatched spending unconfirmed-from-somewhere-else inputs.

I'll be looking out for short-lived 10 million Bitcoin transactions on blockchain.info! :D
The ability to spend unconfirmed outputs doesn't mean you can create coins out of thin air. Sorry to disappoint.


Title: Re: Cannot send unconfirmed coins from rpc.
Post by: BasementMiner! on June 20, 2012, 02:46:09 AM
The RPC and GUI won't let you spend 0-confirmation transactions unless they are 'change' outputs from yourself.

If you REALLY want to shoot yourself in the foot, I've got a pull request for the 0.7 release that adds 'raw transaction' RPC commands that will let you do all sorts of dangerous things, including counting your chickens before they've hatched spending unconfirmed-from-somewhere-else inputs.

I'll be looking out for short-lived 10 million Bitcoin transactions on blockchain.info! :D
The ability to spend unconfirmed outputs doesn't mean you can create coins out of thin air. Sorry to disappoint.
I had seen a 21 million transaction in a unconfirmed state a while back. It soon disappeared, though.


Title: Re: Cannot send unconfirmed coins from rpc.
Post by: mcorlett on June 20, 2012, 02:53:45 AM
I had seen a 21 million transaction in a unconfirmed state a while back. It soon disappeared, though.
Impossible. Perhaps 21 million base units, but not bitcoins.