Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: dgamer5000 on June 04, 2011, 07:29:05 AM



Title: Checking if a transaction is going to require the 0.01BTC transaction fee.
Post by: dgamer5000 on June 04, 2011, 07:29:05 AM
There doesn't seem to be an API Call that can do this. At least, I can't find one. Yet, the bitcoin client is able to do it. Any idea how I can do it?


Title: Re: Checking if a transaction is going to require the 0.01BTC transaction fee.
Post by: theymos on June 04, 2011, 07:41:00 AM
The selected coins are randomized with each send, so an estimate wouldn't be entirely reliable. Someone recently published a patch that added "prepared" transactions, though.

Generally, if you're sending more than a few BTC and the amount you're sending is much less than the total amount of BTC in your wallet, there will be no required fee.


Title: Re: Checking if a transaction is going to require the 0.01BTC transaction fee.
Post by: Gavin Andresen on June 04, 2011, 10:58:57 AM
What theymos said.  There's another thread about this, too, and I'll ask here what I asked there:  what is the use case for an 'estimate transaction fee' function? What if the estimate is wrong, what would your application do?


Title: Re: Checking if a transaction is going to require the 0.01BTC transaction fee.
Post by: Pieter Wuille on June 04, 2011, 11:03:40 AM
See the 3rd commit here: https://github.com/bitcoin/bitcoin/pull/289

It introduces RPC calls to prepare a transaction, inspect it, and then choose to send or cancel it.


Title: Re: Checking if a transaction is going to require the 0.01BTC transaction fee.
Post by: Dude65535 on June 04, 2011, 01:49:50 PM
The estimate being wrong would not be a big problem if there were a way to resend an existing transaction with a fee (or a bigger fee) attached. For the gui I would think the right place for such a command would either be right clicking the 0 confirmation transaction or in the window brought up by double clicking the transaction.


Title: Re: Checking if a transaction is going to require the 0.01BTC transaction fee.
Post by: redshark1802 on June 04, 2011, 03:18:16 PM
Wouldn't it be possible to send X and the client automatically calculates the fees(Y) for it?
Resulting in X(new) = X(old)-Y?

regards, redshark1802