Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: bachel on May 17, 2016, 12:25:00 PM



Title: Bitcoin Api
Post by: bachel on May 17, 2016, 12:25:00 PM
Hi

Does any one know who to use the deduct fee from sending amount via api or bitcoin-cli ? cant figure it out I want to use floating fees instead of a fixed value


Title: Re: Bitcoin Api
Post by: danda on May 18, 2016, 12:58:50 AM
With bitcoin-cli you just call sendtoaddress or sendmany with the tx amount and the software will automatically calculate the necessary fee.  You can retrieve the amount afterward with gettransaction if you need to record it.

Also you can call estimatefee before to get an estimate, but it could be different from the actual amount used due to changing network conditions, etc.

If you absolutely insist to control the exact fee amount yourself you would need to use createrawtransaction, signrawtransaction, sendrawtransaction.


Title: Re: Bitcoin Api
Post by: bachel on May 18, 2016, 06:48:57 AM
With bitcoin-cli you just call sendtoaddress or sendmany with the tx amount and the software will automatically calculate the necessary fee.  You can retrieve the amount afterward with gettransaction if you need to record it.

Also you can call estimatefee before to get an estimate, but it could be different from the actual amount used due to changing network conditions, etc.

If you absolutely insist to control the exact fee amount yourself you would need to use createrawtransaction, signrawtransaction, sendrawtransaction.

yeah I do that right now but I used the gui yesterday and saw that you can set the deduct from amount option in the gui but I cant figure out how to use it via api

I only use my node to redistribute my mining income automaticly and allways keep around 0.015 in the walle for fees but I like the deduct from amount future way more