Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: btcxchange on April 28, 2013, 03:54:49 PM



Title: Tx fee applied when not expected
Post by: btcxchange on April 28, 2013, 03:54:49 PM

I'm using testnet and testing my understanding of txn fees and came across a txn that I would not expect a fee to be applied.

From https://en.bitcoin.it/wiki/Transaction_fees (https://en.bitcoin.it/wiki/Transaction_fees)

Quote
A transaction will be sent without fees if these conditions are met:
It is smaller than 10 thousand bytes.
All outputs are 0.01 BTC or larger.
Its priority is large enough (see the Technical Info section below)

Using the priority formula in the Technical Info section, I calculated the fees for tx e212c55 (http://blockexplorer.com/testnet/tx/e212c55d160c31675a54ab09fb52d3c5d2c1633d927d76a35e1460e9588e524d) using the following information:

Input tx: adff686 (http://blockexplorer.com/testnet/tx/adff6868ff85c0500b67e615a399ff05a47ce290f121c9ecd809ece03d73256b)
Input amt: 399950000
Input age: (Tx e212c55 is in block 68950 - Tx adff686 in block 68414) = 536
Priority = 399950000 x 536 / 225 byte size = 952,769,777.77

This is greater than 57,600,000 priority so why did bitcoind enforce a tx fee of 0.0005?  ???



Title: Re: Tx fee applied when not expected
Post by: grue on April 28, 2013, 04:50:12 PM
did it ask you to pay a fee? or was it automatically included due to settings?


Title: Re: Tx fee applied when not expected
Post by: btcxchange on April 28, 2013, 05:09:57 PM

The client had a smaller fee of 0.00003 set using 'settxfee'. This was correctly applied to two earlier txns (08da53 (http://blockexplorer.com/testnet/tx/08da53f7b9f0f9d3f6e4d4149d5262eb2fbfb8c36273e49d3b8865cc4c466a31) and f8187d (http://blockexplorer.com/testnet/tx/f8187d5da4290ca14301c2e2e3737a2eac70de2c169703949594c37157a0f69d)).

The bitcoind client used 0.0005 automatically for the txn in question.



Title: Re: Tx fee applied when not expected
Post by: DannyHamilton on April 28, 2013, 05:18:39 PM
- snip -
Input age: (Tx e212c55 is in block 68950 - Tx adff686 in block 68414) = 536
- snip -

The age of the input is determined when the transaction is created in the client, not when it is included in a block.  You are using the block that Tx e212c55 was included in to determine age.  How certain are you that there weren't multiple blocks added to the client's blockchain between the initial buliding of the transaction and when it was eventually included in a block?


Title: Re: Tx fee applied when not expected
Post by: btcxchange on April 28, 2013, 06:41:11 PM
How certain are you that there weren't multiple blocks added to the client's blockchain between the initial buliding of the transaction and when it was eventually included in a block?

Not sure if this is what you mean but the txn was initiated only a few mins prior to appearing in the next block so I'd imagine the age is at most 1 or 2 out. The txn was added to the same block 68950 (http://blockexplorer.com/testnet/block/0000000001040f06bc38e384b97d2ce925f503e01e68cbc1cc618fbf446d3015) as the previous txn (f8187d (http://blockexplorer.com/testnet/tx/f8187d5da4290ca14301c2e2e3737a2eac70de2c169703949594c37157a0f69d)) initiated from the same client.




Title: Re: Tx fee applied when not expected
Post by: kjj on April 29, 2013, 11:31:39 AM
Just out of curiosity, did you use sendtoaddress?


Title: Re: Tx fee applied when not expected
Post by: btcxchange on April 30, 2013, 06:45:05 PM

No, I used sendfrom.

I wonder if the client forces the 0.0005 fee for sending a number of transactions in a small time frame.  ???