Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: Abdussamad on April 29, 2013, 04:43:21 PM



Title: sendtoaddress and transaction fee
Post by: Abdussamad on April 29, 2013, 04:43:21 PM
I am a bit confused as to whether I should deduct the transaction fee from the amount argument passed to sendtoaddress or not. For instance if I have a total of 1BTC in my wallet and want to send all of it to another address while also paying a transaction fee of 0.0005 (also configured in bitcoin.conf) do I do:

bitcoind sendtoaddress 1dlkjfldkjlfd 1

or deduct the transaction fee before calling sendtoaddress:

bitcoind sendtoaddress 1dlkjfldkjlfd 0.9995

Which of the above will enable me to empty my wallet completely and also pay a transaction fee of 0.0005 for a fast transaction?



Title: Re: sendtoaddress and transaction fee
Post by: Abdussamad on May 01, 2013, 11:28:25 AM
I'll answer my own question now that I've tried it out. You have to pass the net amount to sendtoaddress. So 0.9995 in the example above.

This should help anyone else who has the same question and winds up on this thread.